Completed
Pull Request — master (#140)
by Christopher
03:07 queued 55s
created
public/old/plugins/datatables/extensions/Scroller/examples/data/ssp.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
 // parameter represents the DataTables column identifier. In this case simple
30 30
 // indexes
31 31
 $columns = [
32
-    ['db' => 'id',         'dt' => 0],
33
-    ['db' => 'firstname',  'dt' => 1],
34
-    ['db' => 'surname',    'dt' => 2],
35
-    ['db' => 'zip',        'dt' => 3],
36
-    ['db' => 'country',    'dt' => 4],
32
+    ['db' => 'id', 'dt' => 0],
33
+    ['db' => 'firstname', 'dt' => 1],
34
+    ['db' => 'surname', 'dt' => 2],
35
+    ['db' => 'zip', 'dt' => 3],
36
+    ['db' => 'country', 'dt' => 4],
37 37
 ];
38 38
 
39 39
 // SQL server connection information
Please login to merge, or discard this patch.
public/old/notification.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 } else {
34 34
     $notificationId = getQueryStringForKey('id');
35 35
     $referer = getQueryStringForKey('click');
36
-    $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/notification.php?id='.$notificationId.'&click='.$referer;
36
+    $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/notification.php?id=' . $notificationId . '&click=' . $referer;
37 37
     header('Location: login.php');
38 38
     exit;
39 39
 }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     // redir if notification has URL
61 61
     $redir = notificationLink($notificationId);
62 62
     if (!empty($redir)) {
63
-        header('Location: '.$redir);
63
+        header('Location: ' . $redir);
64 64
     }
65 65
 
66 66
     // find notification
Please login to merge, or discard this patch.
src/classes/Controller/UserController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     public function getUserEditForm(ServerRequestInterface $request, ResponseInterface $response, $args)
99 99
     {
100
-        $this->logger->info("Fetch user GET '/user/".$args['id']."/edit'");
100
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/edit'");
101 101
         $u = UserQuery::create()->findPK($args['id']);
102 102
 
103 103
         if (is_null($u)) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
     public function getUser(ServerRequestInterface $request, ResponseInterface $response, $args)
114 114
     {
115
-        $this->logger->info("Fetch user GET '/user/".$args['id']."'");
115
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "'");
116 116
         $u = UserQuery::create()->findPK($args['id']);
117 117
 
118 118
         if (is_null($u)) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     public function getUserWidgetOnly(ServerRequestInterface $request, ResponseInterface $response, $args)
129 129
     {
130
-        $this->logger->info("Fetch user GET '/user/".$args['id']."'");
130
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "'");
131 131
         $u = UserQuery::create()->findPK($args['id']);
132 132
 
133 133
         if (is_null($u)) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
     public function getUserPasswordForm(ServerRequestInterface $request, ResponseInterface $response, $args)
144 144
     {
145
-        $this->logger->info("Fetch user GET '/user/".$args['id']."/password'");
145
+        $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/password'");
146 146
         $u = UserQuery::create()->findPK($args['id']);
147 147
 
148 148
         if (is_null($u)) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     public function postUserPasswordChange(ServerRequestInterface $request, ResponseInterface $response, $args)
159 159
     {
160
-        $this->logger->info("Create user POST '/user/".$args['id']."/password'");
160
+        $this->logger->info("Create user POST '/user/" . $args['id'] . "/password'");
161 161
 
162 162
         $data = $request->getParsedBody();
163 163
 
Please login to merge, or discard this patch.
src/classes/AuthProvider/Callback/FacebookAuth.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $path = $this->router->pathFor('login-callback', ['provider' => $this->getAuthProviderSlug()]);
45 45
 
46
-        $url = $this->baseUrl.$path;
46
+        $url = $this->baseUrl . $path;
47 47
 
48 48
         return $helper->getLoginUrl($url, $this->permissions);
49 49
     }
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
             $accessToken = $helper->getAccessToken();
57 57
         } catch (FacebookResponseException $e) {
58 58
             // When Graph returns an error
59
-            echo 'Graph returned an error: '.$e->getMessage();
59
+            echo 'Graph returned an error: ' . $e->getMessage();
60 60
 
61 61
             return false;
62 62
         } catch (FacebookSDKException $e) {
63 63
             // When validation fails or other local issues
64
-            echo 'Facebook SDK returned an error: '.$e->getMessage();
64
+            echo 'Facebook SDK returned an error: ' . $e->getMessage();
65 65
 
66 66
             return false;
67 67
         }
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
         if (!isset($accessToken)) {
70 70
             if ($helper->getError()) {
71 71
                 header('HTTP/1.0 401 Unauthorized');
72
-                echo 'Error: '.$helper->getError()."\n";
73
-                echo 'Error Code: '.$helper->getErrorCode()."\n";
74
-                echo 'Error Reason: '.$helper->getErrorReason()."\n";
75
-                echo 'Error Description: '.$helper->getErrorDescription()."\n";
72
+                echo 'Error: ' . $helper->getError() . "\n";
73
+                echo 'Error Code: ' . $helper->getErrorCode() . "\n";
74
+                echo 'Error Reason: ' . $helper->getErrorReason() . "\n";
75
+                echo 'Error Description: ' . $helper->getErrorDescription() . "\n";
76 76
             } else {
77 77
                 header('HTTP/1.0 400 Bad Request');
78 78
                 echo 'Bad request';
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             try {
99 99
                 $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
100 100
             } catch (FacebookSDKException $e) {
101
-                echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n";
101
+                echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n";
102 102
 
103 103
                 return false;
104 104
             }
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
             // Returns a `Facebook\FacebookResponse` object
123 123
             $response = $this->facebook->get('/me?fields=id,name,email', $accessToken);
124 124
         } catch (Facebook\Exceptions\FacebookResponseException $e) {
125
-            echo 'Graph returned an error: '.$e->getMessage();
125
+            echo 'Graph returned an error: ' . $e->getMessage();
126 126
             exit;
127 127
         } catch (Facebook\Exceptions\FacebookSDKException $e) {
128
-            echo 'Facebook SDK returned an error: '.$e->getMessage();
128
+            echo 'Facebook SDK returned an error: ' . $e->getMessage();
129 129
             exit;
130 130
         }
131 131
 
Please login to merge, or discard this patch.
public/old/error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 <br>
47 47
 The following error has occurred
48 48
 <?php
49
-echo " on page '".$page."':<br><br>";
49
+echo " on page '" . $page . "':<br><br>";
50 50
     echo '<strong>';
51 51
 
52 52
     switch ($no) {
Please login to merge, or discard this patch.
src/classes/Controller/AuthController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function getLoginAuth(ServerRequestInterface $request, ResponseInterface $response, $args)
80 80
     {
81
-        $this->logger->info("Login auth GET '/login/".$args['provider']."'");
81
+        $this->logger->info("Login auth GET '/login/" . $args['provider'] . "'");
82 82
 
83 83
         // login
84 84
         $authUrl = $this->auth->getCallbackUrl();
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function getLoginCallback(ServerRequestInterface $request, ResponseInterface $response, $args)
90 90
     {
91
-        $this->logger->info("Login auth GET '/login/".$args['provider']."/callback'");
91
+        $this->logger->info("Login auth GET '/login/" . $args['provider'] . "/callback'");
92 92
 
93 93
         // login
94 94
         try {
Please login to merge, or discard this patch.
src/classes/Controller/ResourceController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function getResourceEditForm(ServerRequestInterface $request, ResponseInterface $response, $args)
63 63
     {
64
-        $this->logger->info("Fetch resource GET '/resource/".$args['id']."/edit'");
64
+        $this->logger->info("Fetch resource GET '/resource/" . $args['id'] . "/edit'");
65 65
         $d = DocumentQuery::create()->findPK($args['id']);
66 66
 
67 67
         if (!is_null($d)) {
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 
74 74
     public function getResourceFile(ServerRequestInterface $request, ResponseInterface $response, $args)
75 75
     {
76
-        $this->logger->info("Fetch resource GET '/resource/".$args['id']."'");
76
+        $this->logger->info("Fetch resource GET '/resource/" . $args['id'] . "'");
77 77
         $resource = DocumentQuery::create()->findPk($args['id']);
78
-        $directory = __DIR__.'/../../../documents/';
78
+        $directory = __DIR__ . '/../../../documents/';
79 79
 
80 80
         if (!is_null($resource)) {
81
-            if (file_exists($directory.$resource->getUrl())) {
82
-                $file = $directory.$resource->getUrl();
83
-            } elseif (file_exists($directory.$resource->getId())) {
84
-                $file = $directory.$resource->getId();
81
+            if (file_exists($directory . $resource->getUrl())) {
82
+                $file = $directory . $resource->getUrl();
83
+            } elseif (file_exists($directory . $resource->getId())) {
84
+                $file = $directory . $resource->getId();
85 85
             } else {
86 86
                 return $this->view->render($response, 'error.twig');
87 87
             }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                             ->withHeader('Content-Type', 'application/download')
96 96
                             ->withHeader('Content-Description', 'File Transfer')
97 97
                             ->withHeader('Content-Transfer-Encoding', 'binary')
98
-                            ->withHeader('Content-Disposition', 'attachment; filename="'.$resource->getUrl().'"')
98
+                            ->withHeader('Content-Disposition', 'attachment; filename="' . $resource->getUrl() . '"')
99 99
                             ->withHeader('Expires', '0')
100 100
                             ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
101 101
                             ->withHeader('Pragma', 'public')
Please login to merge, or discard this patch.
src/classes/Controller/EventController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function getAllEventsWithType(ServerRequestInterface $request, ResponseInterface $response, $args)
33 33
     {
34
-        $this->logger->info("Fetch event GET '/events/type/".$args['id']."'");
34
+        $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'");
35 35
 
36 36
         $eventType = EventTypeQuery::create()->findPk($args['id']);
37 37
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function getAllEventsWithSubType(ServerRequestInterface $request, ResponseInterface $response, $args)
44 44
     {
45
-        $this->logger->info("Fetch event GET '/events/type/".$args['id']."'");
45
+        $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'");
46 46
 
47 47
         $eventType = EventSubTypeQuery::create()->findPk($args['id']);
48 48
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $e->setCreatedBy($this->auth->currentUser());
86 86
         }
87 87
         $e->setName($data['name']);
88
-        $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'].' '.$data['time']));
88
+        $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'] . ' ' . $data['time']));
89 89
         $e->setEventTypeId($data['type']);
90 90
         $e->setEventSubTypeId($data['subtype']);
91 91
         $e->setLocationId($data['location']);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     public function getEvent(ServerRequestInterface $request, ResponseInterface $response, $args)
120 120
     {
121
-        $this->logger->info("Fetch event GET '/event/".$args['id']."'");
121
+        $this->logger->info("Fetch event GET '/event/" . $args['id'] . "'");
122 122
         $e = EventQuery::create()->findPK($args['id']);
123 123
 
124 124
         if (!$e->authoriser()->readableBy($this->auth->currentUser())) {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
     public function getEventEditForm(ServerRequestInterface $request, ResponseInterface $response, $args)
136 136
     {
137
-        $this->logger->info("Fetch event GET '/event/".$args['id']."/edit'");
137
+        $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/edit'");
138 138
         $e = EventQuery::create()->findPK($args['id']);
139 139
         $l = LocationQuery::create()->orderByName()->find();
140 140
         $et = EventTypeQuery::create()->orderByName()->find();
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
     public function getEventCopyForm(ServerRequestInterface $request, ResponseInterface $response, $args)
151 151
     {
152
-        $this->logger->info("Fetch event GET '/event/".$args['id']."/copy'");
152
+        $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/copy'");
153 153
         $e = EventQuery::create()->findPK($args['id']);
154 154
         $l = LocationQuery::create()->orderByName()->find();
155 155
         $et = EventTypeQuery::create()->orderByName()->find();
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
     public function getEventAssignForm(ServerRequestInterface $request, ResponseInterface $response, $args)
166 166
     {
167
-        $this->logger->info("Fetch event GET '/event/".$args['id']."/assign'");
167
+        $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/assign'");
168 168
         $e = EventQuery::create()->findPK($args['id']);
169 169
         $ur = UserRoleQuery::create()->find();
170 170
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
     public function postEventAssign(ServerRequestInterface $request, ResponseInterface $response, $args)
179 179
     {
180
-        $this->logger->info("Create event people POST '/event".$args['id']."/assign'");
180
+        $this->logger->info("Create event people POST '/event" . $args['id'] . "/assign'");
181 181
 
182 182
         $eventId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT);
183 183
         $existingUserRoles = UserRoleQuery::create()->useEventPersonQuery()->filterByEventId($eventId)->endUse()->find();
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
     public function getAllEventsToPrintForGroup(ServerRequestInterface $request, ResponseInterface $response, $args)
225 225
     {
226
-        $this->logger->info("Fetch event printable page GET '/group/".$args['id']."/events'");
226
+        $this->logger->info("Fetch event printable page GET '/group/" . $args['id'] . "/events'");
227 227
 
228 228
         $groupId = (int) $args['id'];
229 229
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
     public function postEventComment(ServerRequestInterface $request, ResponseInterface $response, $args)
271 271
     {
272
-        $this->logger->info("Create event people POST '/event".$args['id']."/comment'");
272
+        $this->logger->info("Create event people POST '/event" . $args['id'] . "/comment'");
273 273
 
274 274
         $eventId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT);
275 275
 
Please login to merge, or discard this patch.
public/old/cr_daily.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         if ($availableCommits[0]['sha'] !== $commitHash) {
93 93
             $updateAvailable = true;
94 94
 
95
-            $email = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>';
95
+            $email = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>';
96 96
             $message = <<<'MESSAGE'
97 97
 There is an update available for your installation of Rota.
98 98
 
@@ -114,23 +114,23 @@  discard block
 block discarded – undo
114 114
                     WHERE
115 115
                         date >= CURDATE()
116 116
                         AND date_format( date , "%y-%m-%d" )
117
-                                <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert.' DAY ) , "%y-%m-%d" )';
117
+                                <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert . ' DAY ) , "%y-%m-%d" )';
118 118
         $resultEvents = mysqli_query(db(), $sqlEvents) or die(mysqli_error(db()));
119 119
         $i = 0;
120 120
         while ($rowEvents = mysqli_fetch_array($resultEvents, MYSQLI_ASSOC)) {
121 121
             $usersNotified = notifyEveryoneForEvent($rowEvents['id']);
122 122
             if (count($usersNotified) > 0) {
123
-                $out = $out.'Automatic notifications sent to users ('.implode(', ', $usersNotified).') for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n";
123
+                $out = $out . 'Automatic notifications sent to users (' . implode(', ', $usersNotified) . ') for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n";
124 124
             } else {
125
-                $out = $out.'No notifications sent for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n";
125
+                $out = $out . 'No notifications sent for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n";
126 126
             }
127 127
             $i = $i + 1;
128 128
         }
129 129
         if ($i == 0) {
130
-            $out = $out.'No events found to automatically notify for.';
130
+            $out = $out . 'No events found to automatically notify for.';
131 131
         }
132 132
     } else {
133
-        $out = $out.'Automatic notifications are disabled.';
133
+        $out = $out . 'Automatic notifications are disabled.';
134 134
     } ?>
135 135
 <html>
136 136
 	<body>
Please login to merge, or discard this patch.