@@ -15,10 +15,10 @@ discard block |
||
| 15 | 15 | * @throws UserNotFoundException |
| 16 | 16 | * @uses $users |
| 17 | 17 | */ |
| 18 | - public function get( $id ) |
|
| 18 | + public function get($id) |
|
| 19 | 19 | { |
| 20 | - if ($this->has( $id )) { |
|
| 21 | - return $this->users[ $id ]; |
|
| 20 | + if ($this->has($id)) { |
|
| 21 | + return $this->users[$id]; |
|
| 22 | 22 | } |
| 23 | 23 | throw new UserNotFoundException("Could not find User with ID '$id'"); |
| 24 | 24 | } |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | * @return boolean |
| 29 | 29 | * @uses $users |
| 30 | 30 | */ |
| 31 | - public function has ($id ) |
|
| 31 | + public function has($id) |
|
| 32 | 32 | { |
| 33 | - return array_key_exists( $id, $this->users); |
|
| 33 | + return array_key_exists($id, $this->users); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function getIterator() |
| 43 | 43 | { |
| 44 | - return new \ArrayIterator( $this->users ); |
|
| 44 | + return new \ArrayIterator($this->users); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -4,9 +4,9 @@ |
||
| 4 | 4 | class ActiveUsersFilterIterator extends \FilterIterator |
| 5 | 5 | { |
| 6 | 6 | |
| 7 | - public function __construct( \Traversable $users ) |
|
| 7 | + public function __construct(\Traversable $users) |
|
| 8 | 8 | { |
| 9 | - parent::__construct( new \IteratorIterator( $users )); |
|
| 9 | + parent::__construct(new \IteratorIterator($users)); |
|
| 10 | 10 | } |
| 11 | 11 | public function accept() |
| 12 | 12 | { |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | * @param UserAbstract $user Optional: User template object |
| 22 | 22 | * @param string $table Optional: Users table name |
| 23 | 23 | */ |
| 24 | - public function __construct( \PDO $pdo, UserAbstract $user = null, $table = null ) |
|
| 24 | + public function __construct(\PDO $pdo, UserAbstract $user = null, $table = null) |
|
| 25 | 25 | { |
| 26 | - parent::__construct( $pdo, $user, $table ); |
|
| 26 | + parent::__construct($pdo, $user, $table); |
|
| 27 | 27 | |
| 28 | - $active = new ActiveUsersFilterIterator( $this ); |
|
| 29 | - $this->users = iterator_to_array( $active ); |
|
| 28 | + $active = new ActiveUsersFilterIterator($this); |
|
| 29 | + $this->users = iterator_to_array($active); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function getCreationDateTime() |
| 44 | 44 | { |
| 45 | 45 | if ($this->created) |
| 46 | - return \DateTime::createFromFormat( "Y-m-d H:i:s", $this->created ); |
|
| 46 | + return \DateTime::createFromFormat("Y-m-d H:i:s", $this->created); |
|
| 47 | 47 | return $this->created; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function getLastUpdateDateTime() |
| 55 | 55 | { |
| 56 | 56 | if ($this->updated) |
| 57 | - return \DateTime::createFromFormat( "Y-m-d H:i:s", $this->updated ); |
|
| 57 | + return \DateTime::createFromFormat("Y-m-d H:i:s", $this->updated); |
|
| 58 | 58 | return $this->updated; |
| 59 | 59 | |
| 60 | 60 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @param mixed $email |
| 163 | 163 | * @return self |
| 164 | 164 | */ |
| 165 | - public function setEmail( $email) |
|
| 165 | + public function setEmail($email) |
|
| 166 | 166 | { |
| 167 | 167 | $this->email = $email; |
| 168 | 168 | return $this; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @return self |
| 199 | 199 | * @uses $api_key |
| 200 | 200 | */ |
| 201 | - public function setApiKey( $key ) |
|
| 201 | + public function setApiKey($key) |
|
| 202 | 202 | { |
| 203 | 203 | $this->api_key = $key; |
| 204 | 204 | return $this; |
@@ -42,8 +42,9 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function getCreationDateTime() |
| 44 | 44 | { |
| 45 | - if ($this->created) |
|
| 46 | - return \DateTime::createFromFormat( "Y-m-d H:i:s", $this->created ); |
|
| 45 | + if ($this->created) { |
|
| 46 | + return \DateTime::createFromFormat( "Y-m-d H:i:s", $this->created ); |
|
| 47 | + } |
|
| 47 | 48 | return $this->created; |
| 48 | 49 | } |
| 49 | 50 | |
@@ -53,8 +54,9 @@ discard block |
||
| 53 | 54 | */ |
| 54 | 55 | public function getLastUpdateDateTime() |
| 55 | 56 | { |
| 56 | - if ($this->updated) |
|
| 57 | - return \DateTime::createFromFormat( "Y-m-d H:i:s", $this->updated ); |
|
| 57 | + if ($this->updated) { |
|
| 58 | + return \DateTime::createFromFormat( "Y-m-d H:i:s", $this->updated ); |
|
| 59 | + } |
|
| 58 | 60 | return $this->updated; |
| 59 | 61 | |
| 60 | 62 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * @param UserAbstract $user Optional: User template object |
| 22 | 22 | * @param string $table Optional: Users table name |
| 23 | 23 | */ |
| 24 | - public function __construct( \PDO $pdo, UserAbstract $user = null, $table = null ) |
|
| 24 | + public function __construct(\PDO $pdo, UserAbstract $user = null, $table = null) |
|
| 25 | 25 | { |
| 26 | 26 | $this->table = $table ?: $this->table; |
| 27 | 27 | |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | FROM {$this->table}"; |
| 44 | 44 | |
| 45 | - $stmt = $pdo->prepare( $sql ); |
|
| 45 | + $stmt = $pdo->prepare($sql); |
|
| 46 | 46 | |
| 47 | - $stmt->setFetchMode( \PDO::FETCH_CLASS, $user ? get_class($user) : User::class ); |
|
| 47 | + $stmt->setFetchMode(\PDO::FETCH_CLASS, $user ? get_class($user) : User::class); |
|
| 48 | 48 | |
| 49 | 49 | if (!$stmt->execute()): |
| 50 | 50 | throw new \RuntimeException("Could not retrieve Users from database"); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public function getLastUpdateDateTime(); |
| 25 | 25 | |
| 26 | 26 | |
| 27 | - public function setDisplayName( $name ); |
|
| 27 | + public function setDisplayName($name); |
|
| 28 | 28 | public function getDisplayName(); |
| 29 | 29 | |
| 30 | 30 | public function setFirstName($name); |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | public function setLoginName($name); |
| 37 | 37 | public function getLoginName(); |
| 38 | 38 | |
| 39 | - public function setEmail( $email); |
|
| 39 | + public function setEmail($email); |
|
| 40 | 40 | public function getEmail(); |
| 41 | 41 | |
| 42 | 42 | public function getApiKey(); |
| 43 | - public function setApiKey( $key ); |
|
| 43 | + public function setApiKey($key); |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @param UserAbstract $user Optional: User template object |
| 35 | 35 | * @param string $table Optional: Users table name |
| 36 | 36 | */ |
| 37 | - public function __construct( \PDO $pdo, UserAbstract $user = null, $table = null ) |
|
| 37 | + public function __construct(\PDO $pdo, UserAbstract $user = null, $table = null) |
|
| 38 | 38 | { |
| 39 | 39 | $this->pdo = $pdo; |
| 40 | 40 | $this->table = $table ?: $this->table; |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | WHERE U.id = :id |
| 58 | 58 | AND U.is_active > 0"; |
| 59 | 59 | |
| 60 | - $this->stmt = $pdo->prepare( $sql ); |
|
| 60 | + $this->stmt = $pdo->prepare($sql); |
|
| 61 | 61 | |
| 62 | - $this->stmt->setFetchMode( \PDO::FETCH_CLASS, $this->php_users_class ); |
|
| 62 | + $this->stmt->setFetchMode(\PDO::FETCH_CLASS, $this->php_users_class); |
|
| 63 | 63 | |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | - public function has ($id) { |
|
| 76 | + public function has($id) { |
|
| 77 | 77 | if (!$this->stmt->execute([ |
| 78 | 78 | 'id' => $id |
| 79 | 79 | ])): |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - public function get ($id) { |
|
| 87 | + public function get($id) { |
|
| 88 | 88 | if (!$this->stmt->execute([ |
| 89 | 89 | 'id' => $id |
| 90 | 90 | ])): |