Completed
Pull Request — master (#218)
by Christopher
67:05 queued 62:34
created
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/GroupController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 {
14 14
     public function getGroup(ServerRequestInterface $request, ResponseInterface $response, $args)
15 15
     {
16
-        $this->logger->info("Fetch group GET '/group/".$args['id']."'");
16
+        $this->logger->info("Fetch group GET '/group/" . $args['id'] . "'");
17 17
         $events = EventQuery::create()
18 18
             ->useEventPersonQuery()
19 19
                 ->useUserRoleQuery()
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function getGroupRoles(ServerRequestInterface $request, ResponseInterface $response, $args)
38 38
     {
39
-        $this->logger->info("Fetch group roles GET '/group/".$args['id']."/roles'");
39
+        $this->logger->info("Fetch group roles GET '/group/" . $args['id'] . "/roles'");
40 40
         $events = EventQuery::create()
41 41
             ->useEventPersonQuery()
42 42
                 ->useUserRoleQuery()
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
                 ->findPk($args['id']);
59 59
 
60 60
         // temporary redirect
61
-        return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').'old/roles.php');
61
+        return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . 'old/roles.php');
62 62
 
63 63
         return $this->view->render($response, 'group-roles.twig', ['events' => $events, 'group' => $group]);
64 64
     }
65 65
 
66 66
     public function postGroup(ServerRequestInterface $request, ResponseInterface $response, $args)
67 67
     {
68
-        $this->logger->info("Create/edit group POST '/group/".$args['id']."'");
68
+        $this->logger->info("Create/edit group POST '/group/" . $args['id'] . "'");
69 69
 
70 70
         $group = new Group();
71 71
 
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/includes/functions.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@  discard block
 block discarded – undo
6 6
 use Monolog\Handler\StreamHandler;
7 7
 use Monolog\Logger;
8 8
 
9
-include __DIR__.'/errors.php';
9
+include __DIR__ . '/errors.php';
10 10
 
11 11
 // setup the autoloading
12
-require_once __DIR__.'/../../../vendor/autoload.php';
12
+require_once __DIR__ . '/../../../vendor/autoload.php';
13 13
 
14 14
 // setup Propel
15
-require_once __DIR__.'/../../../generated-conf/config.php';
15
+require_once __DIR__ . '/../../../generated-conf/config.php';
16 16
 
17 17
 $defaultLogger = new Logger('defaultLogger');
18
-$defaultLogger->pushHandler(new StreamHandler(__DIR__.'/../../../logs/propel.log', Logger::WARNING));
18
+$defaultLogger->pushHandler(new StreamHandler(__DIR__ . '/../../../logs/propel.log', Logger::WARNING));
19 19
 
20 20
 $serviceContainer->setLogger('defaultLogger', $defaultLogger);
21 21
 
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
     return SettingsQuery::create()->findOne();
65 65
 }
66 66
 
67
-include __DIR__.'/functions.auth.php';
68
-include __DIR__.'/functions.notifications.php';
69
-include __DIR__.'/functions.mail.php';
70
-include __DIR__.'/functions.remove.php';
71
-include __DIR__.'/functions.discussion.php';
72
-include __DIR__.'/functions.event.php';
73
-include __DIR__.'/functions.password.php';
74
-include __DIR__.'/functions.users.php';
75
-include __DIR__.'/functions.roles.php';
76
-include __DIR__.'/functions.database.php';
77
-include __DIR__.'/functions.calendars.php';
78
-include __DIR__.'/functions.facebook.php';
67
+include __DIR__ . '/functions.auth.php';
68
+include __DIR__ . '/functions.notifications.php';
69
+include __DIR__ . '/functions.mail.php';
70
+include __DIR__ . '/functions.remove.php';
71
+include __DIR__ . '/functions.discussion.php';
72
+include __DIR__ . '/functions.event.php';
73
+include __DIR__ . '/functions.password.php';
74
+include __DIR__ . '/functions.users.php';
75
+include __DIR__ . '/functions.roles.php';
76
+include __DIR__ . '/functions.database.php';
77
+include __DIR__ . '/functions.calendars.php';
78
+include __DIR__ . '/functions.facebook.php';
79 79
 
80 80
 date_default_timezone_set(siteSettings()->getTimeZone());
81 81
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $stat_id = $_SESSION['login_statistic_id'];
176 176
         if (($stat_id != '') && ($stat_id != '0')) {
177 177
             $stat = StatisticQuery::create()->findPk($stat_id);
178
-            $stat->setDetail1($stat->getDetail1().'/'.$detail1);
178
+            $stat->setDetail1($stat->getDetail1() . '/' . $detail1);
179 179
             $stat->setDetail2($stat->getDate()->diff(new DateTime()));
180 180
             $stat->save();
181 181
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         return 'never';
209 209
     }
210 210
 
211
-    return timeInWords($time).' ago';
211
+    return timeInWords($time) . ' ago';
212 212
 }
213 213
 
214 214
 function timeInWordsWithTense($time)
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
     }
223 223
 
224 224
     if ($time->getTimestamp() > (new DateTime())->getTimestamp()) {
225
-        return 'in '.timeInWords($time);
225
+        return 'in ' . timeInWords($time);
226 226
     } else {
227
-        return timeInWords($time).' ago';
227
+        return timeInWords($time) . ' ago';
228 228
     }
229 229
 }
230 230
 
Please login to merge, or discard this patch.
src/classes/Controller/JobController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         }
20 20
 
21 21
         $client = new Client();
22
-        $url = $site->getUrl()['base'].$this->router->pathFor('home').'old/cr_daily.php';
22
+        $url = $site->getUrl()['base'] . $this->router->pathFor('home') . 'old/cr_daily.php';
23 23
         $guzzleResponse = $client->get($url, [
24 24
             'query' => [
25 25
                 'token' => $args['token'],
Please login to merge, or discard this patch.
src/classes/Controller/NotificationController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function getNotificationClick(ServerRequestInterface $request, ResponseInterface $response, $args)
13 13
     {
14
-        $this->logger->info("Fetch settings GET '/notification/".$args['id']."'");
14
+        $this->logger->info("Fetch settings GET '/notification/" . $args['id'] . "'");
15 15
 
16 16
         $n = NotificationQuery::create()->findPk($args['id']);
17 17
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
                 return $response->withStatus(302)->withHeader('Location', $this->router->pathFor($link['route'], $link['attributes']));
37 37
             } else {
38
-                return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').$n->getLink());
38
+                return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . $n->getLink());
39 39
             }
40 40
         }
41 41
 
Please login to merge, or discard this patch.
public/old/recordingUpload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 // only load page if functionality enabled
20 20
 if (siteConfig()['recording']['type'] != 'locomotivecms') {
21 21
     echo '<p>This feature is not enabled</p>';
22
-    echo '<p><a href='.siteSettings()->getSiteUrl().'>&lt; back to homepage</a></p>';
22
+    echo '<p><a href=' . siteSettings()->getSiteUrl() . '>&lt; back to homepage</a></p>';
23 23
     exit;
24 24
 }
25 25
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 $client = new Client([
29 29
     // Base URI is used with relative requests
30
-    'base_uri' => siteConfig()['recording']['locomotivecms']['url'].'/locomotive/api/',
30
+    'base_uri' => siteConfig()['recording']['locomotivecms']['url'] . '/locomotive/api/',
31 31
     // You can set any number of default request options.
32 32
     'timeout' => 2.0,
33 33
 ]);
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
     var_dump($response);
53 53
 } else {
54 54
     echo '<p>Unable to connect to main site</p>';
55
-    echo '<p><a href='.siteSettings()->getSiteUrl().'>&lt; back to homepage</a></p>';
55
+    echo '<p><a href=' . siteSettings()->getSiteUrl() . '>&lt; back to homepage</a></p>';
56 56
     exit;
57 57
 }
Please login to merge, or discard this patch.
src/dependencies.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $container = $app->getContainer();
22 22
 
23 23
 // TWIG view renderer
24
-$container['view'] = function ($c) {
24
+$container['view'] = function($c) {
25 25
     $settings = $c->get('settings')['renderer'];
26 26
     $view = new Twig($settings['template_path'], [
27 27
         'cache' => false, // or 'path/to/cache'
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     $env = $view->getEnvironment();
47 47
     $env->addGlobal('site', new Site());
48 48
     $env->addGlobal('currenturl', $c->get('request')->getUri());
49
-    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath().'/'.$c->get('request')->getUri()->getPath());
49
+    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath() . '/' . $c->get('request')->getUri()->getPath());
50 50
 
51 51
     if (isset($_SESSION['userId'])) {
52 52
         $u = UserQuery::create()->findPk($_SESSION['userId']);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 };
60 60
 
61 61
 // monolog
62
-$container['logger'] = function ($c) {
62
+$container['logger'] = function($c) {
63 63
     $settings = $c->get('settings')['logger'];
64 64
     $logger = new Monolog\Logger($settings['name']);
65 65
     $logger->pushProcessor(new Monolog\Processor\UidProcessor());
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     return $logger;
69 69
 };
70 70
 
71
-$container['auth'] = function ($c) {
71
+$container['auth'] = function($c) {
72 72
     $authConfig = getConfig()['auth'];
73 73
 
74 74
     // full domain e.g. https://example.com
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             break;
87 87
 
88 88
         case 'onebody':
89
-            $url = $authConfig['onebody']['url'].'/';
89
+            $url = $authConfig['onebody']['url'] . '/';
90 90
             $email = new EmailAddress($authConfig['onebody']['email']);
91 91
             $apiKey = $authConfig['onebody']['apiKey'];
92 92
 
@@ -116,6 +116,6 @@  discard block
 block discarded – undo
116 116
     return new Authentication($c, $authProvider, $allowedRoutes);
117 117
 };
118 118
 
119
-$container['csrf'] = function ($c) {
119
+$container['csrf'] = function($c) {
120 120
     return new Guard();
121 121
 };
Please login to merge, or discard this patch.
src/middleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // Application middleware
9 9
 
10 10
 // 4) add route information to twig
11
-$app->add(function (Request $request, Response $response, callable $next) {
11
+$app->add(function(Request $request, Response $response, callable $next) {
12 12
     $route = $request->getAttribute('route');
13 13
 
14 14
     // return NotFound for non existent route
Please login to merge, or discard this patch.