Skip to content

Commit d2aa123

Browse files
committed
Fix PHP warnings
1 parent 524bdfb commit d2aa123

File tree

6 files changed

+32
-2
lines changed

6 files changed

+32
-2
lines changed

src/WebApp/DataModel/AccessLog.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44

55
class AccessLog {
66

7+
public $uid;
8+
public $session_id;
79
public $log_time;
10+
public $response_code;
11+
public $method;
12+
public $path;
13+
public $referer;
14+
public $ua;
15+
public $user_id;
816

917
public function __construct() {
1018
if (is_string($this->log_time)) $this->log_time = new \TgUtils\Date($this->log_time, WFW_TIMEZONE);

src/WebApp/DataModel/Address.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Address {
1414
public $zipCode;
1515
public $city;
1616
public $country;
17+
public $province;
1718

1819
public function __construct() {
1920
}
@@ -24,7 +25,7 @@ public function isComplete($includeName = FALSE) {
2425

2526
public static function isAddressComplete($address, $includeName = FALSE) {
2627
$rc = !Utils::isEmpty($address->street1) && !Utils::isEmpty($address->zipCode) && !Utils::isEmpty($address->city) && !Utils::isEmpty($address->country);
27-
if ($rc && $includeName) $rc = !Utils::isEmpty($address->name);
28+
if ($rc && $includeName) $rc = isset($address->name) && !Utils::isEmpty($address->name);
2829
return $rc;
2930
}
3031

src/WebApp/DataModel/Log.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
class Log {
66

7+
public $log_text;
8+
public $log_date;
9+
710
public function __construct() {
811
if (is_string($this->log_text)) $this->log_text = json_decode($this->log_text);
912
if (is_string($this->log_date)) $this->log_date = new \TgUtils\Date($this->log_date, WFW_TIMEZONE);

src/WebApp/DataModel/Session.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
class Session {
66

7+
public $uid;
8+
public $creation_time;
9+
public $update_time;
10+
public $expiry_time;
11+
public $data;
12+
public $persistent;
13+
714
public function __construct() {
815
}
916

src/WebApp/DataModel/User.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ class User implements \WebApp\Auth\Principal {
1010
public const STATUS_DISABLED = 'disabled';
1111
public const STATUS_DELETED = 'deleted';
1212

13+
public $uid;
14+
public $created_on;
15+
public $email;
16+
public $password;
17+
public $name;
18+
public $roles;
19+
public $status;
20+
public $data;
21+
1322
public function __construct() {
14-
$this->created_on = new \TgUtils\Date($this->created_on, WFW_TIMEZONE);
23+
if (is_string($this->created_on)) $this->created_on = new \TgUtils\Date($this->created_on, WFW_TIMEZONE);
1524
}
1625

1726
/**

src/WebApp/DataModel/UserRole.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class UserRole {
1111
/** A defined role that can do everything */
1212
public const ROLE_SUPERADMIN = 'superadmin';
1313

14+
public $privileges;
15+
1416
public function __construct() {
1517
}
1618

0 commit comments

Comments
 (0)