Completed
Push — master ( 0789c7...4b7f5b )
by Carsten
10:22 queued 04:56
created
src/Users.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/PdoUserFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      * @param UserAbstract  $user   Optional: User template object
30 30
      * @param string        $table  Optional: Users table name
31 31
      */
32
-    public function __construct( \PDO $pdo, UserAbstract $user = null, $table = null )
32
+    public function __construct(\PDO $pdo, UserAbstract $user = null, $table = null)
33 33
     {
34 34
         $this->pdo      = $pdo;
35 35
         $this->table    = $table ?: $this->table;
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         WHERE U.id = :id
50 50
         AND   U.is_active > 0";
51 51
 
52
-        $this->stmt = $pdo->prepare( $sql );
52
+        $this->stmt = $pdo->prepare($sql);
53 53
 
54
-        $this->stmt->setFetchMode( \PDO::FETCH_CLASS, $user ? get_class($user) : User::class );
54
+        $this->stmt->setFetchMode(\PDO::FETCH_CLASS, $user ? get_class($user) : User::class);
55 55
 
56 56
     }
57 57
 
58 58
 
59
-    public function has ($id) {
59
+    public function has($id) {
60 60
         if (!$this->stmt->execute([
61 61
             'id' => $id
62 62
         ])):
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
 
70
-    public function get ($id) {
70
+    public function get($id) {
71 71
         if (!$this->stmt->execute([
72 72
             'id' => $id
73 73
         ])):
Please login to merge, or discard this patch.
src/ActiveUsersFilterIterator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/PdoAllActiveUsers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/UserAbstract.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/PdoAllUsers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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");
Please login to merge, or discard this patch.
src/UserInterface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.