Completed
Branch master (a049c8)
by Christopher
12:07
created
api-classes/Database.php 1 patch
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -148,6 +148,12 @@  discard block
 block discarded – undo
148 148
         return $statement->fetchAll(PDO::FETCH_CLASS, $returnClass);
149 149
     }
150 150
 
151
+    /**
152
+     * @param string $returnClass
153
+     * @param string $table
154
+     * @param string[] $columns
155
+     * @param string[] $where
156
+     */
151 157
     public function selectSingle($returnClass, $table, $columns, $where = null)
152 158
     {
153 159
         $statement = $this->selectStatement($table, $columns, $where);
@@ -215,6 +221,8 @@  discard block
 block discarded – undo
215 221
 
216 222
   /**
217 223
    * Use with caution: it is often better to archive items to prevent creating null references.
224
+   * @param string $table
225
+   * @param string[] $where
218 226
    */
219 227
   public function delete($table, $where)
220 228
   {
@@ -253,6 +261,9 @@  discard block
 block discarded – undo
253 261
         return $table;
254 262
     }
255 263
 
264
+    /**
265
+     * @param string $table
266
+     */
256 267
     private function tableExists($table)
257 268
     {
258 269
         // todo: implement table check
Please login to merge, or discard this patch.
generated-classes/TechWilk/Rota/User.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
     /**
197 197
      * Determine if the user is marked as available for an event.
198 198
      *
199
-     * @return bool if user is available
199
+     * @return null|boolean if user is available
200 200
      */
201 201
     public function isAvailableForEvent(Event $event)
202 202
     {
Please login to merge, or discard this patch.
src/classes/Authentication.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -119,6 +119,9 @@
 block discarded – undo
119 119
         return true;
120 120
     }
121 121
 
122
+    /**
123
+     * @param EmailAddress $username
124
+     */
122 125
     private function numberOfLoginAttemptsIsOk($username)
123 126
     {
124 127
         $numberOfAllowedAttempts = 8;
Please login to merge, or discard this patch.
public/old/swap.php 1 patch
Switch Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
   case 'accept':
65 65
     if (canAcceptSwap($swapId) || $verify == verificationCodeForSwap($swapId)) {
66 66
         switch (acceptSwap($swapId)) {
67
-        case '1':
68
-          $message = 'Swap Successful';
69
-          break;
70
-        case '2':
71
-          $message = 'Swap already accepted.';
72
-          break;
73
-        case '3':
74
-          $message = 'Swap already declined.';
75
-          break;
76
-        case '4':
77
-          $message = 'Swap already reverted.';
78
-          break;
79
-        default:
80
-          $err = 'Technical issue - please inform system administrator';
81
-          break;
67
+            case '1':
68
+              $message = 'Swap Successful';
69
+              break;
70
+            case '2':
71
+              $message = 'Swap already accepted.';
72
+              break;
73
+            case '3':
74
+              $message = 'Swap already declined.';
75
+              break;
76
+            case '4':
77
+              $message = 'Swap already reverted.';
78
+              break;
79
+            default:
80
+              $err = 'Technical issue - please inform system administrator';
81
+              break;
82 82
       }
83 83
     } else {
84 84
         $err = 'Swap Already Actioned or Verification Code Invalid';
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
   case 'decline':
88 88
     if (canDeclineSwap($swapId) || $verify == verificationCodeForSwap($swapId)) {
89 89
         switch (declineSwap($swapId)) {
90
-        case '1':
91
-          $message = 'Swap declined';
92
-          break;
93
-        case '2':
94
-          $message = 'Swap already declined.';
95
-          break;
96
-        default:
97
-          $err = 'Technical issue - please inform system administrator';
98
-          break;
90
+            case '1':
91
+              $message = 'Swap declined';
92
+              break;
93
+            case '2':
94
+              $message = 'Swap already declined.';
95
+              break;
96
+            default:
97
+              $err = 'Technical issue - please inform system administrator';
98
+              break;
99 99
         }
100 100
     } else {
101 101
         $err = 'Swap Already Actioned or Verification Code Invalid';
Please login to merge, or discard this patch.
public/old/pendingAccounts.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -28,25 +28,25 @@
 block discarded – undo
28 28
     $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT);
29 29
 
30 30
     switch ($_POST['action']) {
31
-    case 'approve':
32
-      $userId = approvePendingUser($id);
33
-      mailNewUser($userId);
34
-      header('Location: addUser.php?action=edit&user='.$userId);
35
-      break;
36
-    case 'merge':
37
-      $existingUserId = $_POST['existingUser'];
38
-      $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT);
39
-      mergePendingUserWithUserId($id, $existingUserId);
40
-      mailNewUser($existingUserId);
41
-      header('Location: addUser.php?action=edit&user='.$existingUserId);
42
-      break;
43
-    case 'decline':
44
-      declinePendingUser($id);
45
-      break;
46
-
47
-    default:
48
-      // code...
49
-      break;
31
+        case 'approve':
32
+          $userId = approvePendingUser($id);
33
+          mailNewUser($userId);
34
+          header('Location: addUser.php?action=edit&user='.$userId);
35
+          break;
36
+        case 'merge':
37
+          $existingUserId = $_POST['existingUser'];
38
+          $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT);
39
+          mergePendingUserWithUserId($id, $existingUserId);
40
+          mailNewUser($existingUserId);
41
+          header('Location: addUser.php?action=edit&user='.$existingUserId);
42
+          break;
43
+        case 'decline':
44
+          declinePendingUser($id);
45
+          break;
46
+
47
+        default:
48
+          // code...
49
+          break;
50 50
   }
51 51
 }
52 52
 
Please login to merge, or discard this patch.
public/old/calendarTokens.php 1 patch
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -21,36 +21,36 @@
 block discarded – undo
21 21
     $method = $_POST['method'];
22 22
 
23 23
     switch ($method) {
24
-    case 'revoke':
25
-      $id = $_POST['id'];
26
-      $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT);
24
+        case 'revoke':
25
+          $id = $_POST['id'];
26
+          $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT);
27 27
 
28
-      revokeCalendarToken($id);
29
-      header('Location: calendarTokens.php');
30
-      break;
31
-
32
-    default:
33
-      // generate new URL
34
-      $format = $_POST['format'];
35
-      $description = $_POST['description'];
36
-
37
-      if (empty($format)) {
38
-          $error = 'Format must be set';
39
-          break;
40
-      }
41
-      if (empty($description)) {
42
-          $error = 'Device or software name cannot be empty';
28
+          revokeCalendarToken($id);
29
+          header('Location: calendarTokens.php');
43 30
           break;
44
-      }
45
-      $count = CalendarTokenQuery::create()->filterByUserId($sessionUserId)->filterByDescription($description)->filterByRevoked(false)->count();
46
-      if ($count > 0) {
47
-          $error = 'You already have a calendar for the same device or software name. Please revoke the existing token or use a different name.';
48
-          break;
49
-      }
50 31
 
51
-      $token = createCalendarToken($sessionUserId, $format, $description);
52
-      $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token";
53
-      break;
32
+        default:
33
+          // generate new URL
34
+          $format = $_POST['format'];
35
+          $description = $_POST['description'];
36
+
37
+          if (empty($format)) {
38
+              $error = 'Format must be set';
39
+              break;
40
+          }
41
+          if (empty($description)) {
42
+              $error = 'Device or software name cannot be empty';
43
+              break;
44
+          }
45
+          $count = CalendarTokenQuery::create()->filterByUserId($sessionUserId)->filterByDescription($description)->filterByRevoked(false)->count();
46
+          if ($count > 0) {
47
+              $error = 'You already have a calendar for the same device or software name. Please revoke the existing token or use a different name.';
48
+              break;
49
+          }
50
+
51
+          $token = createCalendarToken($sessionUserId, $format, $description);
52
+          $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token";
53
+          break;
54 54
   }
55 55
 }
56 56
 
Please login to merge, or discard this patch.
public/old/linkSocialAuth.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,22 +37,22 @@
 block discarded – undo
37 37
     $platform = strtolower($_POST['platform']);
38 38
 
39 39
     switch ($_POST['action']) {
40
-    case 'link':
41
-      switch ($platform) {
40
+        case 'link':
41
+          switch ($platform) {
42 42
         case 'facebook':
43 43
           $_SESSION['fb-callback-url'] = 'fb-link.php';
44 44
           header('Location: fb-login.php');
45 45
           exit;
46
-      }
47
-      break;
48
-    case 'unlink':
49
-      removeSocialAuthFromUserWithId($id, $platform);
50
-      createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account.  Login via Facebook is now disabled for your account.  Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php');
51
-      break;
52
-
53
-    default:
54
-      // code...
46
+          }
55 47
       break;
48
+        case 'unlink':
49
+          removeSocialAuthFromUserWithId($id, $platform);
50
+          createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account.  Login via Facebook is now disabled for your account.  Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php');
51
+          break;
52
+
53
+        default:
54
+          // code...
55
+          break;
56 56
   }
57 57
 }
58 58
 
Please login to merge, or discard this patch.