@@ -246,10 +246,10 @@ |
||
246 | 246 | return $this; |
247 | 247 | } |
248 | 248 | |
249 | - /** |
|
250 | - * StorableTrait > preSave(): Called automatically before saving the object to source. |
|
251 | - * @return boolean |
|
252 | - */ |
|
249 | + /** |
|
250 | + * StorableTrait > preSave(): Called automatically before saving the object to source. |
|
251 | + * @return boolean |
|
252 | + */ |
|
253 | 253 | public function preSave() |
254 | 254 | { |
255 | 255 | parent::preSave(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
126 | - * @param DateTimeInterface|string|null $expiry The date/time at object's creation. |
|
126 | + * @param string $expiry The date/time at object's creation. |
|
127 | 127 | * @throws InvalidArgumentException If the date/time is invalid. |
128 | 128 | * @return AuthToken Chainable |
129 | 129 | */ |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * @param DateTimeInterface|string|null $created The date/time at object's creation. |
|
157 | + * @param string $created The date/time at object's creation. |
|
158 | 158 | * @throws InvalidArgumentException If the date/time is invalid. |
159 | 159 | * @return AuthToken Chainable |
160 | 160 | */ |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
188 | - * @param DateTimeInterface|string|null $lastModified The last modified date/time. |
|
188 | + * @param string $lastModified The last modified date/time. |
|
189 | 189 | * @throws InvalidArgumentException If the date/time is invalid. |
190 | 190 | * @return AuthToken Chainable |
191 | 191 | */ |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | /** |
304 | 304 | * @param mixed $ident The auth-token identifier. |
305 | 305 | * @param string $token The token key to validate against. |
306 | - * @return mixed The user id. |
|
306 | + * @return string The user id. |
|
307 | 307 | */ |
308 | 308 | public function getUserId($ident, $token) |
309 | 309 | { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | /** |
314 | 314 | * @param mixed $ident The auth-token identifier (username). |
315 | 315 | * @param string $token The token to validate against. |
316 | - * @return mixed The user id. An empty string if no token match. |
|
316 | + * @return string The user id. An empty string if no token match. |
|
317 | 317 | */ |
318 | 318 | public function getUsernameFromToken($ident, $token) |
319 | 319 | { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param string $resource The Acl resource (string identifier) to load roles and permissions into. |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - public function loadPermissions(Acl &$acl, array $permissions, $resource = '') |
|
41 | + public function loadPermissions(Acl&$acl, array $permissions, $resource = '') |
|
42 | 42 | { |
43 | 43 | foreach ($permissions as $role => $rolePermissions) { |
44 | 44 | $this->addRoleAndPermissions($acl, $role, $rolePermissions, $resource); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param string $resource The Acl resource (string identifier) to load roles and permissions into. |
53 | 53 | * @return void |
54 | 54 | */ |
55 | - public function loadDatabasePermissions(Acl &$acl, PDO $db, $table, $resource = '') |
|
55 | + public function loadDatabasePermissions(Acl&$acl, PDO $db, $table, $resource = '') |
|
56 | 56 | { |
57 | 57 | // Quick-and-dirty sanitization |
58 | 58 | $table = preg_replace('/[^A-Za-z0-9_]/', '', $table); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param string $resource The Acl resource (string identifier) to add roles and permissions into. |
90 | 90 | * @return void |
91 | 91 | */ |
92 | - private function addRoleAndPermissions(Acl &$acl, $role, array $permissions, $resource) |
|
92 | + private function addRoleAndPermissions(Acl&$acl, $role, array $permissions, $resource) |
|
93 | 93 | { |
94 | 94 | if (!$acl->hasRole($role)) { |
95 | 95 | // Add role |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
233 | - * @param string|DateTimeInterface|null $lastLoginDate The last login date. |
|
233 | + * @param string $lastLoginDate The last login date. |
|
234 | 234 | * @throws InvalidArgumentException If the ts is not a valid date/time. |
235 | 235 | * @return UserInterface Chainable |
236 | 236 | */ |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
312 | - * @param string|DateTimeInterface|null $lastPasswordDate The last password date. |
|
312 | + * @param string $lastPasswordDate The last password date. |
|
313 | 313 | * @throws InvalidArgumentException If the passsword date is not a valid DateTime. |
314 | 314 | * @return UserInterface Chainable |
315 | 315 | */ |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $this->setLastLoginIp($ip); |
455 | 455 | } |
456 | 456 | |
457 | - $this->update([ 'last_login_ip', 'last_login_date' ]); |
|
457 | + $this->update(['last_login_ip', 'last_login_date']); |
|
458 | 458 | |
459 | 459 | $this->saveToSession(); |
460 | 460 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | } |
542 | 542 | |
543 | 543 | if ($this->id()) { |
544 | - $this->update([ 'password', 'last_password_date', 'last_password_ip' ]); |
|
544 | + $this->update(['password', 'last_password_date', 'last_password_ip']); |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | return $this; |
@@ -3,9 +3,7 @@ |
||
3 | 3 | namespace Charcoal\User\Acl; |
4 | 4 | |
5 | 5 | use InvalidArgumentException; |
6 | - |
|
7 | 6 | use Pimple\Container; |
8 | - |
|
9 | 7 | use Charcoal\Translator\TranslatorAwareTrait; |
10 | 8 | |
11 | 9 | // From 'charcoal-core' |