Completed
Push — master ( f2ef51...ef379e )
by Patrick
03:21
created
class.Singleton.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     {
29 29
         static $instances = array();
30 30
         $class = get_called_class();
31
-        if(!isset($instances[$class]))
31
+        if (!isset($instances[$class]))
32 32
         {
33 33
             $instances[$class] = new static();
34 34
         }
Please login to merge, or discard this patch.
class.ODataParams.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
         if(isset($params['filter']))
16 16
         {
17 17
             $this->filter = new \Data\Filter($params['filter']);
18
-        }
19
-        else if(isset($params['$filter']))
18
+        } else if(isset($params['$filter']))
20 19
         {
21 20
             $this->filter = new \Data\Filter($params['$filter']);
22 21
         }
@@ -29,8 +28,7 @@  discard block
 block discarded – undo
29 28
         if(isset($params['select']))
30 29
         {
31 30
             $this->select = explode(',',$params['select']);
32
-        }
33
-        else if(isset($params['$select']))
31
+        } else if(isset($params['$select']))
34 32
         {
35 33
             $this->select = explode(',',$params['$select']);
36 34
         }
@@ -47,8 +45,7 @@  discard block
 block discarded – undo
47 45
                 {
48 46
                     //Default to assending
49 47
                     $this->orderby[$exp[0]] = 1;
50
-                }
51
-                else
48
+                } else
52 49
                 {
53 50
                     switch($exp[1])
54 51
                     {
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 
53 53
     protected function processFilter($params)
54 54
     {
55
-        if(isset($params['filter']))
55
+        if (isset($params['filter']))
56 56
         {
57 57
             $this->filter = new \Data\Filter($params['filter']);
58 58
         }
59
-        else if(isset($params['$filter']))
59
+        else if (isset($params['$filter']))
60 60
         {
61 61
             $this->filter = new \Data\Filter($params['$filter']);
62 62
         }
@@ -64,42 +64,42 @@  discard block
 block discarded – undo
64 64
 
65 65
     protected function processExpand($params)
66 66
     {
67
-        if(isset($params['$expand']))
67
+        if (isset($params['$expand']))
68 68
         {
69
-            $this->expand = explode(',',$params['$expand']);
69
+            $this->expand = explode(',', $params['$expand']);
70 70
         }
71 71
     }
72 72
 
73 73
     protected function processSelect($params)
74 74
     {
75
-        if(isset($params['select']))
75
+        if (isset($params['select']))
76 76
         {
77
-            $this->select = explode(',',$params['select']);
77
+            $this->select = explode(',', $params['select']);
78 78
         }
79
-        else if(isset($params['$select']))
79
+        else if (isset($params['$select']))
80 80
         {
81
-            $this->select = explode(',',$params['$select']);
81
+            $this->select = explode(',', $params['$select']);
82 82
         }
83 83
     }
84 84
 
85 85
     protected function processOrderBy($params)
86 86
     {
87
-        if(isset($params['$orderby']))
87
+        if (isset($params['$orderby']))
88 88
         {
89 89
             $this->orderby = array();
90
-            $orderby = explode(',',$params['$orderby']);
90
+            $orderby = explode(',', $params['$orderby']);
91 91
             $count = count($orderby);
92
-            for($i = 0; $i < $count; $i++)
92
+            for ($i = 0; $i < $count; $i++)
93 93
             {
94
-                $exp = explode(' ',$orderby[$i]);
95
-                if(count($exp) === 1)
94
+                $exp = explode(' ', $orderby[$i]);
95
+                if (count($exp) === 1)
96 96
                 {
97 97
                     //Default to assending
98 98
                     $this->orderby[$exp[0]] = 1;
99 99
                 }
100 100
                 else
101 101
                 {
102
-                    switch($exp[1])
102
+                    switch ($exp[1])
103 103
                     {
104 104
                         case 'asc':
105 105
                             $this->orderby[$exp[0]] = 1;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
     protected function processTop($params)
119 119
     {
120
-        if(isset($params['$top']) && is_numeric($params['$top']))
120
+        if (isset($params['$top']) && is_numeric($params['$top']))
121 121
         {
122 122
             $this->top = intval($params['$top']);
123 123
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
     protected function processSkip($params)
127 127
     {
128
-        if(isset($params['$skip']) && is_numeric($params['$skip']))
128
+        if (isset($params['$skip']) && is_numeric($params['$skip']))
129 129
         {
130 130
             $this->skip = intval($params['$skip']);
131 131
         }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
     protected function processCount($params)
135 135
     {
136
-        if(isset($params['$count']) && strcasecmp($params['$count'], 'true') === 0)
136
+        if (isset($params['$count']) && strcasecmp($params['$count'], 'true') === 0)
137 137
         {
138 138
             $this->count = true;
139 139
         }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
     protected function processSearch($params)
143 143
     {
144
-        if(isset($params['$search']))
144
+        if (isset($params['$search']))
145 145
         {
146 146
             throw new Exception('Search not yet implemented');
147 147
         }
Please login to merge, or discard this patch.
Auth/OAuth2/class.LiveAuthenticator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     public function getUserFromToken($token)
32 32
     {
33
-        if($token === false)
33
+        if ($token === false)
34 34
         {
35 35
             $token = \FlipSession::getVar('OAuthToken');
36 36
         }
Please login to merge, or discard this patch.
Auth/class.User.php 3 patches
Doc Comments   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @param string $name The name of the group to check if the user is in
33 33
      *
34
-     * @return true|false True if the user is in the group, false otherwise
34
+     * @return boolean True if the user is in the group, false otherwise
35 35
      */
36 36
     function isInGroupNamed($name)
37 37
     {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * The name the user should be displayed as
43 43
      *
44
-     * @return string The name the user should be displayed as
44
+     * @return boolean The name the user should be displayed as
45 45
      */
46 46
     function getDisplayName()
47 47
     {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     /**
52 52
      * The given (or first) name for the user
53 53
      *
54
-     * @return string The user's first name
54
+     * @return boolean The user's first name
55 55
      */
56 56
     function getGivenName()
57 57
     {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     /**
62 62
      * The email address for the user
63 63
      *
64
-     * @return string The user's email address
64
+     * @return boolean The user's email address
65 65
      */
66 66
     function getEmail()
67 67
     {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     /**
72 72
      * The user ID for the user
73 73
      *
74
-     * @return string The user's ID or username
74
+     * @return boolean The user's ID or username
75 75
      */
76 76
     function getUid()
77 77
     {
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     /**
82 82
      * The photo for the user
83 83
      *
84
-     * @return string The user's photo as a binary string
84
+     * @return boolean The user's photo as a binary string
85 85
      */ 
86 86
     function getPhoto()
87 87
     {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     /**
92 92
      * The phone number for the user
93 93
      *
94
-     * @return false|string The user's phone number
94
+     * @return boolean The user's phone number
95 95
      */
96 96
     function getPhoneNumber()
97 97
     {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     /**
102 102
      * The organziation for the user
103 103
      *
104
-     * @return false|string The user's organization
104
+     * @return boolean The user's organization
105 105
      */
106 106
     function getOrganization()
107 107
     {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * The list of titles for the user
113 113
      *
114
-     * @return array The user's title(s) in short format
114
+     * @return boolean The user's title(s) in short format
115 115
      */
116 116
     function getTitles()
117 117
     {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     /**
122 122
      * The list of titles for the user
123 123
      *
124
-     * @return array The user's title(s) in user friendly strings
124
+     * @return boolean The user's title(s) in user friendly strings
125 125
      *
126 126
      * @SuppressWarnings("StaticAccess")
127 127
      */
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     /**
160 160
      * The state the user's mailing address is in
161 161
      *
162
-     * @return string The user's state from their mailing address
162
+     * @return boolean The user's state from their mailing address
163 163
      */
164 164
     function getState()
165 165
     {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     /**
170 170
      * The city the user's mailing address is in
171 171
      *
172
-     * @return string The user's city from their mailing address
172
+     * @return boolean The user's city from their mailing address
173 173
      */
174 174
     function getCity()
175 175
     {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     /**
180 180
      * The last name for the user
181 181
      *
182
-     * @return string The user's last name
182
+     * @return boolean The user's last name
183 183
      */
184 184
     function getLastName()
185 185
     {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     /**
190 190
      * The nick name for the user
191 191
      *
192
-     * @return string The user's nick name
192
+     * @return boolean The user's nick name
193 193
      */
194 194
     function getNickName()
195 195
     {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     /**
200 200
      * The street address for the user
201 201
      *
202
-     * @return string The user's street address
202
+     * @return boolean The user's street address
203 203
      */
204 204
     function getAddress()
205 205
     {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     /**
210 210
      * The postal (zip) code for the user's mailing address
211 211
      *
212
-     * @return string The user's postal code
212
+     * @return boolean The user's postal code
213 213
      */
214 214
     function getPostalCode()
215 215
     {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     /**
220 220
      * The country the user's mailing address is in
221 221
      *
222
-     * @return string The user's country from their mailing address
222
+     * @return boolean The user's country from their mailing address
223 223
      */
224 224
     function getCountry()
225 225
     {
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      *
232 232
      * This is the same as Areas in Flipside speak. 
233 233
      *
234
-     * @return array The user's orgnaiational units
234
+     * @return boolean The user's orgnaiational units
235 235
      */
236 236
     function getOrganizationUnits()
237 237
     {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
     /**
242 242
      * The supplemental login types that the user can use to login
243 243
      *
244
-     * @return array The user's login providers
244
+     * @return boolean The user's login providers
245 245
      */
246 246
     function getLoginProviders()
247 247
     {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     /**
252 252
      * The groups the user is a part of
253 253
      *
254
-     * @return false|array The user's Auth\Group structures
254
+     * @return boolean The user's Auth\Group structures
255 255
      */
256 256
     function getGroups()
257 257
     {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      *
276 276
      * @param string $provider The hostname for the provider
277 277
      *
278
-     * @return true|false true if they can login with the provider, false otherwise
278
+     * @return boolean true if they can login with the provider, false otherwise
279 279
      */
280 280
     function canLoginWith($provider)
281 281
     {
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      *
295 295
      * @param string $password The new user password
296 296
      *
297
-     * @return true|false true if the user's password was changed, false otherwise
297
+     * @return boolean true if the user's password was changed, false otherwise
298 298
      */
299 299
     protected function setPass($password)
300 300
     {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     /**
305 305
      * Has the user completely filled out their user profile?
306 306
      *
307
-     * @return true|false true if the user's profile is complete, false otherwise
307
+     * @return boolean true if the user's profile is complete, false otherwise
308 308
      */
309 309
     function isProfileComplete()
310 310
     {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      *
323 323
      * @param string $password The user's current password
324 324
      *
325
-     * @return true|false true if the user's password is correct, false otherwise
325
+     * @return boolean true if the user's password is correct, false otherwise
326 326
      *
327 327
      * @SuppressWarnings("UnusedFormalParameter")
328 328
      */
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      *
337 337
      * @param string $hash The user's reset hash
338 338
      *
339
-     * @return true|false true if the user's hash is correct, false otherwise
339
+     * @return boolean true if the user's hash is correct, false otherwise
340 340
      *
341 341
      * @SuppressWarnings("UnusedFormalParameter")
342 342
      */
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
      * @param string $newpass The user's new password
353 353
      * @param boolean $isHash Is $old_pass a password or a hash
354 354
      *
355
-     * @return true|false true if the user's password was changed, false otherwise
355
+     * @return boolean true if the user's password was changed, false otherwise
356 356
      */
357 357
     function change_pass($oldpass, $newpass, $isHash=false)
358 358
     {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      *
377 377
      * @param string $name The user's new display name
378 378
      *
379
-     * @return true|false true if the user's display name was changed, false otherwise
379
+     * @return boolean true if the user's display name was changed, false otherwise
380 380
      */
381 381
     function setDisplayName($name)
382 382
     {
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
      *
389 389
      * @param string $name The user's new given name
390 390
      *
391
-     * @return true|false true if the user's given name was changed, false otherwise
391
+     * @return boolean true if the user's given name was changed, false otherwise
392 392
      */
393 393
     function setGivenName($name)
394 394
     {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
      *
401 401
      * @param string $email The user's new email address
402 402
      *
403
-     * @return true|false true if the user's email address was changed, false otherwise
403
+     * @return boolean true if the user's email address was changed, false otherwise
404 404
      *
405 405
      * @SuppressWarnings("UnusedFormalParameter")
406 406
      */
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
      *
415 415
      * @param string $uid The user's new user ID
416 416
      *
417
-     * @return true|false true if the user's ID was changed, false otherwise
417
+     * @return boolean true if the user's ID was changed, false otherwise
418 418
      *
419 419
      * @SuppressWarnings("UnusedFormalParameter")
420 420
      */
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
      *
429 429
      * @param string $photo The user's new photo as a binary string
430 430
      *
431
-     * @return true|false true if the user's photo was changed, false otherwise
431
+     * @return boolean true if the user's photo was changed, false otherwise
432 432
      *
433 433
      * @SuppressWarnings("UnusedFormalParameter")
434 434
      */
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
      *
443 443
      * @param string $phone The user's new phonew number
444 444
      *
445
-     * @return true|false true if the user's phone number was changed, false otherwise
445
+     * @return boolean true if the user's phone number was changed, false otherwise
446 446
      *
447 447
      * @SuppressWarnings("UnusedFormalParameter")
448 448
      */
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      *
457 457
      * @param string $org The user's new organization
458 458
      *
459
-     * @return true|false true if the user's organization was changed, false otherwise
459
+     * @return boolean true if the user's organization was changed, false otherwise
460 460
      *
461 461
      * @SuppressWarnings("UnusedFormalParameter")
462 462
      */
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
      *
471 471
      * @param string $titles The user's new titles
472 472
      *
473
-     * @return true|false true if the user's titles were changed, false otherwise
473
+     * @return boolean true if the user's titles were changed, false otherwise
474 474
      *
475 475
      * @SuppressWarnings("UnusedFormalParameter")
476 476
      */
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
      *
485 485
      * @param string $state The user's new state
486 486
      *
487
-     * @return true|false true if the user's state was changed, false otherwise
487
+     * @return boolean true if the user's state was changed, false otherwise
488 488
      *
489 489
      * @SuppressWarnings("UnusedFormalParameter")
490 490
      */
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
      *
499 499
      * @param string $city The user's new city
500 500
      *
501
-     * @return true|false true if the user's city was changed, false otherwise
501
+     * @return boolean true if the user's city was changed, false otherwise
502 502
      *
503 503
      * @SuppressWarnings("UnusedFormalParameter")
504 504
      */
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
      *
513 513
      * @param string $sn The user's new last name
514 514
      *
515
-     * @return true|false true if the user's last name was changed, false otherwise
515
+     * @return boolean true if the user's last name was changed, false otherwise
516 516
      *
517 517
      * @SuppressWarnings("UnusedFormalParameter")
518 518
      */
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
      *
527 527
      * @param string $displayName The user's new nick name
528 528
      *
529
-     * @return true|false true if the user's nick name was changed, false otherwise
529
+     * @return boolean true if the user's nick name was changed, false otherwise
530 530
      */
531 531
     function setNickName($displayName)
532 532
     {
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
      *
539 539
      * @param string $address The user's new mailing address
540 540
      *
541
-     * @return true|false true if the user's mailing address was changed, false otherwise
541
+     * @return boolean true if the user's mailing address was changed, false otherwise
542 542
      *
543 543
      * @SuppressWarnings("UnusedFormalParameter")
544 544
      */
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
      *
553 553
      * @param string $postalcode The user's new postal code
554 554
      *
555
-     * @return true|false true if the user's postal code was changed, false otherwise
555
+     * @return boolean true if the user's postal code was changed, false otherwise
556 556
      *
557 557
      * @SuppressWarnings("UnusedFormalParameter")
558 558
      */
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
      *
567 567
      * @param string $country The user's new country
568 568
      *
569
-     * @return true|false true if the user's country was changed, false otherwise
569
+     * @return boolean true if the user's country was changed, false otherwise
570 570
      *
571 571
      * @SuppressWarnings("UnusedFormalParameter")
572 572
      */
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
      *
581 581
      * @param string $ous The user's new organizations
582 582
      *
583
-     * @return true|false true if the user's organizations was changed, false otherwise
583
+     * @return boolean true if the user's organizations was changed, false otherwise
584 584
      *
585 585
      * @SuppressWarnings("UnusedFormalParameter")
586 586
      */
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
     /**
705 705
      * Obtain the user's password reset hash
706 706
      *
707
-     * @return string|false A hash if available, false otherwise
707
+     * @return boolean A hash if available, false otherwise
708 708
      */
709 709
     public function getPasswordResetHash()
710 710
     {
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -128,26 +128,26 @@  discard block
 block discarded – undo
128 128
     public function getTitleNames()
129 129
     {
130 130
         $titles = $this->getTitles();
131
-        if($titles === false)
131
+        if ($titles === false)
132 132
         {
133 133
             return false;
134 134
         }
135
-        if(self::$titlenames === null)
135
+        if (self::$titlenames === null)
136 136
         {
137 137
             $dataSet = \DataSetFactory::getDataSetByName('profiles');
138 138
             $dataTable = $dataSet['position'];
139 139
             $titlenames = $dataTable->read();
140 140
             self::$titlenames = array();
141 141
             $count = count($titlenames);
142
-            for($i = 0; $i < $count; $i++)
142
+            for ($i = 0; $i < $count; $i++)
143 143
             {
144 144
                 self::$titlenames[$titlenames[$i]['short_name']] = $titlenames[$i];
145 145
             }
146 146
         }
147 147
         $count = count($titles);
148
-        for($i = 0; $i < $count; $i++)
148
+        for ($i = 0; $i < $count; $i++)
149 149
         {
150
-            if(isset(self::$titlenames[$titles[$i]]))
150
+            if (isset(self::$titlenames[$titles[$i]]))
151 151
             {
152 152
                 $title = self::$titlenames[$titles[$i]];
153 153
                 $titles[$i] = $title['name'];
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
     public function canLoginWith($provider)
281 281
     {
282 282
         $hosts = $this->getLoginProviders();
283
-        if($hosts === false) return false;
283
+        if ($hosts === false) return false;
284 284
         $count = count($hosts);
285
-        for($i = 0; $i < $count; $i++)
285
+        for ($i = 0; $i < $count; $i++)
286 286
         {
287
-            if(strcasecmp($hosts[$i], $provider) === 0) return true;
287
+            if (strcasecmp($hosts[$i], $provider) === 0) return true;
288 288
         }
289 289
         return false;
290 290
     }
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function isProfileComplete()
310 310
     {
311
-        if($this->getCountry() === false    || $this->getAddress() === false ||
311
+        if ($this->getCountry() === false || $this->getAddress() === false ||
312 312
            $this->getPostalCode() === false || $this->getCity() === false ||
313
-           $this->getState() === false      || $this->getPhoneNumber() === false)
313
+           $this->getState() === false || $this->getPhoneNumber() === false)
314 314
         {
315 315
             return false;
316 316
         }
@@ -354,17 +354,17 @@  discard block
 block discarded – undo
354 354
      *
355 355
      * @return true|false true if the user's password was changed, false otherwise
356 356
      */
357
-    public function change_pass($oldpass, $newpass, $isHash=false)
357
+    public function change_pass($oldpass, $newpass, $isHash = false)
358 358
     {
359
-        if($isHash === false && $this->validate_password($oldpass) === false)
359
+        if ($isHash === false && $this->validate_password($oldpass) === false)
360 360
         {
361 361
             throw new \Exception('Invalid Password!', 3);
362 362
         }
363
-        if($isHash === true && $this->validate_reset_hash($oldpass) === false)
363
+        if ($isHash === true && $this->validate_reset_hash($oldpass) === false)
364 364
         {
365 365
             throw new \Exception('Invalid Reset Hash!', 3);
366 366
         }
367
-        if($this->setPass($newpass) === false)
367
+        if ($this->setPass($newpass) === false)
368 368
         {
369 369
             throw new \Exception('Unable to set password!', 6);
370 370
         }
@@ -605,14 +605,14 @@  discard block
 block discarded – undo
605 605
      */
606 606
     private function editUserPassword($data)
607 607
     {
608
-        if(isset($data->password))
608
+        if (isset($data->password))
609 609
         {
610
-            if(isset($data->oldpass))
610
+            if (isset($data->oldpass))
611 611
             {
612 612
                 $this->change_pass($data->oldpass, $data->password);
613 613
                 unset($data->oldpass);
614 614
             }
615
-            else if(isset($data->hash))
615
+            else if (isset($data->hash))
616 616
             {
617 617
                 $this->change_pass($data->hash, $data->password, true);
618 618
                 unset($data->hash);
@@ -623,22 +623,22 @@  discard block
 block discarded – undo
623 623
 
624 624
     private function editNames($data)
625 625
     {
626
-        if(isset($data->displayName))
626
+        if (isset($data->displayName))
627 627
         {
628 628
             $this->setDisplayName($data->displayName);
629 629
             unset($data->displayName);
630 630
         }
631
-        if(isset($data->givenName))
631
+        if (isset($data->givenName))
632 632
         {
633 633
             $this->setGivenName($data->givenName);
634 634
             unset($data->givenName);
635 635
         }
636
-        if(isset($data->sn))
636
+        if (isset($data->sn))
637 637
         {
638 638
             $this->setLastName($data->sn);
639 639
             unset($data->sn);
640 640
         }
641
-        if(isset($data->cn))
641
+        if (isset($data->cn))
642 642
         {
643 643
             $this->setNickName($data->cn);
644 644
             unset($data->cn);
@@ -647,17 +647,17 @@  discard block
 block discarded – undo
647 647
 
648 648
     private function checkForUnsettableElements($data)
649 649
     {
650
-        if(isset($data->mail))
650
+        if (isset($data->mail))
651 651
         {
652
-            if($data->mail !== $this->getEmail())
652
+            if ($data->mail !== $this->getEmail())
653 653
             {
654 654
                 throw new \Exception('Unable to change email!');
655 655
             }
656 656
             unset($data->mail);
657 657
         }
658
-        if(isset($data->uid))
658
+        if (isset($data->uid))
659 659
         {
660
-            if($data->uid !== $this->getUid())
660
+            if ($data->uid !== $this->getUid())
661 661
             {
662 662
                 throw new \Exception('Unable to change uid!');
663 663
             }
@@ -667,27 +667,27 @@  discard block
 block discarded – undo
667 667
 
668 668
     private function editAddressElements($data)
669 669
     {
670
-        if(isset($data->postalAddress))
670
+        if (isset($data->postalAddress))
671 671
         {
672 672
             $this->setAddress($data->postalAddress);
673 673
             unset($data->postalAddress);
674 674
         }
675
-        if(isset($data->l))
675
+        if (isset($data->l))
676 676
         {
677 677
             $this->setCity($data->l);
678 678
             unset($data->l);
679 679
         }
680
-        if(isset($data->st))
680
+        if (isset($data->st))
681 681
         {
682 682
             $this->setState($data->st);
683 683
             unset($data->st);
684 684
         }
685
-        if(isset($data->postalCode))
685
+        if (isset($data->postalCode))
686 686
         {
687 687
             $this->setPostalCode($data->postalCode);
688 688
             unset($data->postalCode);
689 689
         }
690
-        if(isset($data->c))
690
+        if (isset($data->c))
691 691
         {
692 692
             $this->setCountry($data->c);
693 693
             unset($data->c);
@@ -696,17 +696,17 @@  discard block
 block discarded – undo
696 696
 
697 697
     private function editOrganizationElements($data)
698 698
     {
699
-        if(isset($data->o))
699
+        if (isset($data->o))
700 700
         {
701 701
             $this->setOrganization($data->o);
702 702
             unset($data->o);
703 703
         }
704
-        if(isset($data->title))
704
+        if (isset($data->title))
705 705
         {
706 706
             $this->setTitles($data->title);
707 707
             unset($data->title);
708 708
         }
709
-        if(isset($data->ou))
709
+        if (isset($data->ou))
710 710
         {
711 711
             $this->setOrganizationUnits($data->ou);
712 712
             unset($data->ou);
@@ -730,12 +730,12 @@  discard block
 block discarded – undo
730 730
         $this->editAddressElements($data);
731 731
         $this->editOrganizationElements($data);
732 732
 
733
-        if(isset($data->jpegPhoto))
733
+        if (isset($data->jpegPhoto))
734 734
         {
735 735
             $this->setPhoto(base64_decode($data->jpegPhoto));
736 736
             unset($data->jpegPhoto);
737 737
         }
738
-        if(isset($data->mobile))
738
+        if (isset($data->mobile))
739 739
         {
740 740
             $this->setPhoneNumber($data->mobile);
741 741
             unset($data->mobile);
@@ -790,13 +790,13 @@  discard block
 block discarded – undo
790 790
     public function getVcard()
791 791
     {
792 792
         $ret = "BEGIN:VCARD\nVERSION:2.1\n";
793
-        $ret.= 'N:'.$this->getLastName().';'.$this->getGivenName()."\n";
794
-        $ret.= 'FN:'.$this->getGivenName()."\n";
795
-        $ret.= 'TITLE:'.implode(',', $this->getTitles())."\n";
796
-        $ret.= "ORG: Austin Artistic Reconstruction\n";
797
-        $ret.= 'TEL;TYPE=MOBILE,VOICE:'.$this->getPhoneNumber()."\n";
798
-        $ret.= 'EMAIL;TYPE=PREF,INTERNET:'.$this->getEmail()."\n";
799
-        $ret.= "END:VCARD\n";
793
+        $ret .= 'N:'.$this->getLastName().';'.$this->getGivenName()."\n";
794
+        $ret .= 'FN:'.$this->getGivenName()."\n";
795
+        $ret .= 'TITLE:'.implode(',', $this->getTitles())."\n";
796
+        $ret .= "ORG: Austin Artistic Reconstruction\n";
797
+        $ret .= 'TEL;TYPE=MOBILE,VOICE:'.$this->getPhoneNumber()."\n";
798
+        $ret .= 'EMAIL;TYPE=PREF,INTERNET:'.$this->getEmail()."\n";
799
+        $ret .= "END:VCARD\n";
800 800
         return $ret;
801 801
     }
802 802
 }
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -280,11 +280,15 @@  discard block
 block discarded – undo
280 280
     public function canLoginWith($provider)
281 281
     {
282 282
         $hosts = $this->getLoginProviders();
283
-        if($hosts === false) return false;
283
+        if($hosts === false) {
284
+            return false;
285
+        }
284 286
         $count = count($hosts);
285 287
         for($i = 0; $i < $count; $i++)
286 288
         {
287
-            if(strcasecmp($hosts[$i], $provider) === 0) return true;
289
+            if(strcasecmp($hosts[$i], $provider) === 0) {
290
+                return true;
291
+            }
288 292
         }
289 293
         return false;
290 294
     }
@@ -611,8 +615,7 @@  discard block
 block discarded – undo
611 615
             {
612 616
                 $this->change_pass($data->oldpass, $data->password);
613 617
                 unset($data->oldpass);
614
-            }
615
-            else if(isset($data->hash))
618
+            } else if(isset($data->hash))
616 619
             {
617 620
                 $this->change_pass($data->hash, $data->password, true);
618 621
                 unset($data->hash);
Please login to merge, or discard this patch.
Data/class.MongoDataTable.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
     protected $collection;
7 7
     protected $namespace;
8 8
 
9
-    public function __construct($collection, $collection_name=false)
9
+    public function __construct($collection, $collection_name = false)
10 10
     {
11
-        if($collection_name !== false)
11
+        if ($collection_name !== false)
12 12
         {
13 13
             $this->namespace = $collection.'.'.$collection_name;
14 14
         }
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
         }
19 19
     }
20 20
 
21
-    public function count($filter=false)
21
+    public function count($filter = false)
22 22
     {
23 23
         $criteria = array();
24
-        if($filter !== false)
24
+        if ($filter !== false)
25 25
         {
26
-            if($filter instanceof \Data\Filter)
26
+            if ($filter instanceof \Data\Filter)
27 27
             {
28 28
                 $criteria = $filter->to_mongo_filter();
29 29
             }
@@ -37,44 +37,44 @@  discard block
 block discarded – undo
37 37
 
38 38
     private function getCriteriaFromFilter($filter)
39 39
     {
40
-        if($filter === false)
40
+        if ($filter === false)
41 41
         {
42 42
             return array();
43 43
         }
44
-        if(is_array($filter))
44
+        if (is_array($filter))
45 45
         {
46 46
             return $filter;
47 47
         }
48 48
         return $filter->to_mongo_filter();
49 49
     }
50 50
 
51
-    public function search($filter=false, $select=false, $count=false, $skip=false, $sort=false, $params=false)
51
+    public function search($filter = false, $select = false, $count = false, $skip = false, $sort = false, $params = false)
52 52
     {
53 53
         $fields   = array();
54 54
         $criteria = $this->getCriteriaFromFilter($filter);
55
-        if($select !== false)
55
+        if ($select !== false)
56 56
         {
57 57
             $fields = array_fill_keys($select, 1);
58 58
         }
59
-        $cursor   = $this->collection->find($criteria, $fields);
60
-        if($params !== false && isset($params['fields']))
59
+        $cursor = $this->collection->find($criteria, $fields);
60
+        if ($params !== false && isset($params['fields']))
61 61
         {
62 62
             $cursor->fields($params['fields']);
63 63
         }
64
-        if($sort  !== false)
64
+        if ($sort !== false)
65 65
         {
66 66
             $cursor->sort($sort);
67 67
         }
68
-        if($skip  !== false)
68
+        if ($skip !== false)
69 69
         {
70 70
             $cursor->skip($skip);
71 71
         }
72
-        if($count !== false)
72
+        if ($count !== false)
73 73
         {
74 74
             $cursor->limit($count);
75 75
         }
76
-        $ret      = array();
77
-        foreach($cursor as $doc)
76
+        $ret = array();
77
+        foreach ($cursor as $doc)
78 78
         {
79 79
             array_push($ret, $doc);
80 80
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function create($data)
85 85
     {
86 86
         $res = $this->collection->insert($data);
87
-        if($res === false || $res['err'] !== null)
87
+        if ($res === false || $res['err'] !== null)
88 88
         {
89 89
             return false;
90 90
         }
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
     public function update($filter, $data)
95 95
     {
96 96
         $criteria = $this->getCriteriaFromFilter($filter);
97
-        if(isset($data['_id']))
97
+        if (isset($data['_id']))
98 98
         {
99 99
             unset($data['_id']);
100 100
         }
101 101
         $res = $this->collection->update($criteria, array('$set' => $data));
102
-        if($res === false || $res['err'] !== null)
102
+        if ($res === false || $res['err'] !== null)
103 103
         {
104 104
             return false;
105 105
         }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $criteria = $this->getCriteriaFromFilter($filter);
112 112
         $res = $this->collection->remove($criteria);
113
-        if($res === false || $res['err'] !== null)
113
+        if ($res === false || $res['err'] !== null)
114 114
         {
115 115
             return false;
116 116
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
         if($collection_name !== false)
12 12
         {
13 13
             $this->namespace = $collection.'.'.$collection_name;
14
-        }
15
-        else
14
+        } else
16 15
         {
17 16
             $this->collection = $collection;
18 17
         }
@@ -26,8 +25,7 @@  discard block
 block discarded – undo
26 25
             if($filter instanceof \Data\Filter)
27 26
             {
28 27
                 $criteria = $filter->to_mongo_filter();
29
-            }
30
-            else
28
+            } else
31 29
             {
32 30
                 $criteria = $filter;
33 31
             }
Please login to merge, or discard this patch.
Auth/class.SQLUser.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     {
38 38
         if(isset($this->data['mail']))
39 39
         {
40
-             return $this->data['mail'];
40
+                return $this->data['mail'];
41 41
         }
42 42
         return $this->getUid();
43 43
     }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@  discard block
 block discarded – undo
6 6
     private $data;
7 7
     private $auth;
8 8
 
9
-    function __construct($data=false, $auth=false)
9
+    function __construct($data = false, $auth = false)
10 10
     {
11 11
         $this->data = array();
12 12
         $this->auth = $auth;
13
-        if($data !== false)
13
+        if ($data !== false)
14 14
         {
15 15
             $this->data = $data;
16
-            if(isset($data['extended']))
16
+            if (isset($data['extended']))
17 17
             {
18 18
                 $this->data = $data['extended'];
19 19
             }
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $uid = $this->getUid();
28 28
         $filter = new \Data\Filter("uid eq '$uid' and gid eq '$name'");
29 29
         $groups = $group_data_table->read($filter);
30
-        if($groups === false || !isset($groups[0]))
30
+        if ($groups === false || !isset($groups[0]))
31 31
         {
32 32
             return false;
33 33
         }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     function getEmail()
39 39
     {
40
-        if(isset($this->data['mail']))
40
+        if (isset($this->data['mail']))
41 41
         {
42 42
              return $this->data['mail'];
43 43
         }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     function getUid()
48 48
     {
49
-        if(isset($this->data['uid']))
49
+        if (isset($this->data['uid']))
50 50
         {
51 51
             return $this->data['uid'];
52 52
         }
Please login to merge, or discard this patch.
Auth/class.SQLGroup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
     public function getGroupName()
14 14
     {
15
-        if(isset($data['gid']))
15
+        if (isset($data['gid']))
16 16
         {
17 17
             return $data['gid'];
18 18
         }
@@ -21,19 +21,19 @@  discard block
 block discarded – undo
21 21
 
22 22
     public function getDescription()
23 23
     {
24
-        if(isset($data['description']))
24
+        if (isset($data['description']))
25 25
         {
26 26
             return $data['description'];
27 27
         }
28 28
         return false;
29 29
     }
30 30
 
31
-    public function getMemberUids($recursive=true)
31
+    public function getMemberUids($recursive = true)
32 32
     {
33 33
         return $this->members(false, $recursive, true);
34 34
     }
35 35
 
36
-    public function members($details=false, $recursive=true, $includeGroups=true)
36
+    public function members($details = false, $recursive = true, $includeGroups = true)
37 37
     {
38 38
         //TODO
39 39
         return array();
Please login to merge, or discard this patch.