@@ -28,13 +28,13 @@ |
||
28 | 28 | $currentTimestamp = $date = strftime('%F %T', time()); |
29 | 29 | |
30 | 30 | $data = [ |
31 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
32 | - ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
33 | - ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
34 | - ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
35 | - ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
36 | - ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
37 | - ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
31 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
32 | + ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
33 | + ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
34 | + ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
35 | + ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
36 | + ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
37 | + ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | if (isset($this->notes)) { |
@@ -24,12 +24,12 @@ |
||
24 | 24 | public function createInDb(Database $db) |
25 | 25 | { |
26 | 26 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->sub_type) || empty($this->location)) { |
27 | - $message = 'Series name ('.$this->name.')'; |
|
28 | - $message .= ' or date ('.$this->datetime.')'; |
|
29 | - $message .= ' or series ('.$this->series.')'; |
|
30 | - $message .= ' or type ('.$this->type.')'; |
|
31 | - $message .= ' or sub_type ('.$this->sub_type.')'; |
|
32 | - $message .= ' or location ('.$this->location.')'; |
|
27 | + $message = 'Series name (' . $this->name . ')'; |
|
28 | + $message .= ' or date (' . $this->datetime . ')'; |
|
29 | + $message .= ' or series (' . $this->series . ')'; |
|
30 | + $message .= ' or type (' . $this->type . ')'; |
|
31 | + $message .= ' or sub_type (' . $this->sub_type . ')'; |
|
32 | + $message .= ' or location (' . $this->location . ')'; |
|
33 | 33 | $message .= ' cannot be empty.'; |
34 | 34 | |
35 | 35 | throw new Exception($message); |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | $currentTimestamp = $date = strftime('%F %T', time()); |
132 | 132 | |
133 | 133 | $data = [ |
134 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
135 | - ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
136 | - ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
137 | - ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
138 | - ['field' => 'subType', 'type' => 'int', 'value' => $this->subType->getId()], |
|
139 | - ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
140 | - ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
134 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
135 | + ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
136 | + ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
137 | + ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
138 | + ['field' => 'subType', 'type' => 'int', 'value' => $this->subType->getId()], |
|
139 | + ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
140 | + ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
141 | 141 | ]; |
142 | 142 | |
143 | 143 | if (isset($this->notes)) { |
@@ -164,23 +164,23 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | $columns = [ |
167 | - 'id', |
|
168 | - 'name', |
|
169 | - 'date', |
|
170 | - 'eventGroup', |
|
171 | - 'type', |
|
172 | - 'subType', |
|
173 | - 'location', |
|
174 | - 'comment', |
|
175 | - 'sermonTitle', |
|
176 | - 'bibleVerse', |
|
177 | - 'deleted', |
|
178 | - 'created', |
|
179 | - 'updated', |
|
167 | + 'id', |
|
168 | + 'name', |
|
169 | + 'date', |
|
170 | + 'eventGroup', |
|
171 | + 'type', |
|
172 | + 'subType', |
|
173 | + 'location', |
|
174 | + 'comment', |
|
175 | + 'sermonTitle', |
|
176 | + 'bibleVerse', |
|
177 | + 'deleted', |
|
178 | + 'created', |
|
179 | + 'updated', |
|
180 | 180 | ]; |
181 | 181 | |
182 | 182 | $where = [ |
183 | - 'id = '.$id, |
|
183 | + 'id = '.$id, |
|
184 | 184 | ]; |
185 | 185 | |
186 | 186 | $result = $db->selectSingle('Event', $this->db_table, $columns, $where); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | foreach ($rehersals as $rehersal) { |
110 | 110 | if (!is_a($rehersal, 'Rehersal')) { |
111 | - throw new Exception('Rehersal is not a Rehersal object: '.$rehersal, 1); |
|
111 | + throw new Exception('Rehersal is not a Rehersal object: ' . $rehersal, 1); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | $this->rehersals = $rehersals; |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | public function createInDb(Database $db) |
118 | 118 | { |
119 | 119 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->subType) || empty($this->location)) { |
120 | - $message = 'Series name ('.$this->name.')'; |
|
121 | - $message .= ' or date ('.$this->datetime.')'; |
|
122 | - $message .= ' or series ('.$this->series.')'; |
|
123 | - $message .= ' or type ('.$this->type.')'; |
|
124 | - $message .= ' or sub_type ('.$this->subType.')'; |
|
125 | - $message .= ' or location ('.$this->location.')'; |
|
120 | + $message = 'Series name (' . $this->name . ')'; |
|
121 | + $message .= ' or date (' . $this->datetime . ')'; |
|
122 | + $message .= ' or series (' . $this->series . ')'; |
|
123 | + $message .= ' or type (' . $this->type . ')'; |
|
124 | + $message .= ' or sub_type (' . $this->subType . ')'; |
|
125 | + $message .= ' or location (' . $this->location . ')'; |
|
126 | 126 | $message .= ' cannot be empty.'; |
127 | 127 | |
128 | 128 | throw new Exception($message); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | ]; |
181 | 181 | |
182 | 182 | $where = [ |
183 | - 'id = '.$id, |
|
183 | + 'id = ' . $id, |
|
184 | 184 | ]; |
185 | 185 | |
186 | 186 | $result = $db->selectSingle('Event', $this->db_table, $columns, $where); |
@@ -97,7 +97,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function getAllEventsWithType(ServerRequestInterface $request, ResponseInterface $response, $args) |
31 | 31 | { |
32 | - $this->logger->info("Fetch event GET '/events/type/".$args['id']."'"); |
|
32 | + $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'"); |
|
33 | 33 | |
34 | 34 | $eventType = EventTypeQuery::create()->findPk($args['id']); |
35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function getAllEventsWithSubType(ServerRequestInterface $request, ResponseInterface $response, $args) |
42 | 42 | { |
43 | - $this->logger->info("Fetch event GET '/events/type/".$args['id']."'"); |
|
43 | + $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'"); |
|
44 | 44 | |
45 | 45 | $eventType = EventSubTypeQuery::create()->findPk($args['id']); |
46 | 46 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $e = EventQuery::create()->findPk($args['id']); |
70 | 70 | } |
71 | 71 | $e->setName($data['name']); |
72 | - $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'].' '.$data['time'])); |
|
72 | + $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'] . ' ' . $data['time'])); |
|
73 | 73 | $e->setEventTypeId($data['type']); |
74 | 74 | $e->setEventSubTypeId($data['subtype']); |
75 | 75 | $e->setLocationId($data['location']); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | public function getEvent(ServerRequestInterface $request, ResponseInterface $response, $args) |
98 | 98 | { |
99 | - $this->logger->info("Fetch event GET '/event/".$args['id']."'"); |
|
99 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "'"); |
|
100 | 100 | $e = EventQuery::create()->findPK($args['id']); |
101 | 101 | |
102 | 102 | if (!$e->authoriser()->readableBy($this->auth->currentUser())) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | public function getEventEditForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
114 | 114 | { |
115 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/edit'"); |
|
115 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/edit'"); |
|
116 | 116 | $e = EventQuery::create()->findPK($args['id']); |
117 | 117 | $l = LocationQuery::create()->orderByName()->find(); |
118 | 118 | $et = EventTypeQuery::create()->orderByName()->find(); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | public function getEventCopyForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
129 | 129 | { |
130 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/copy'"); |
|
130 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/copy'"); |
|
131 | 131 | $e = EventQuery::create()->findPK($args['id']); |
132 | 132 | $l = LocationQuery::create()->orderByName()->find(); |
133 | 133 | $et = EventTypeQuery::create()->orderByName()->find(); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | public function getEventAssignForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
144 | 144 | { |
145 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/assign'"); |
|
145 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/assign'"); |
|
146 | 146 | $e = EventQuery::create()->findPK($args['id']); |
147 | 147 | $ur = UserRoleQuery::create()->find(); |
148 | 148 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | public function postEventAssign(ServerRequestInterface $request, ResponseInterface $response, $args) |
157 | 157 | { |
158 | - $this->logger->info("Create event people POST '/event".$args['id']."/assign'"); |
|
158 | + $this->logger->info("Create event people POST '/event" . $args['id'] . "/assign'"); |
|
159 | 159 | |
160 | 160 | $eventId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT); |
161 | 161 | $existingUserRoles = UserRoleQuery::create()->useEventPersonQuery()->filterByEventId($eventId)->endUse()->find(); |
@@ -78,7 +78,7 @@ discard block |
||
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($this->router); |
@@ -88,7 +88,7 @@ discard block |
||
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 { |
@@ -43,7 +43,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $container = $app->getContainer(); |
20 | 20 | |
21 | 21 | // TWIG view renderer |
22 | -$container['view'] = function ($c) { |
|
22 | +$container['view'] = function($c) { |
|
23 | 23 | $settings = $c->get('settings')['renderer']; |
24 | 24 | $view = new Twig($settings['template_path'], [ |
25 | 25 | 'cache' => false, // or 'path/to/cache' |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $env = $view->getEnvironment(); |
42 | 42 | $env->addGlobal('site', new Site()); |
43 | 43 | $env->addGlobal('currenturl', $c->get('request')->getUri()); |
44 | - $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath().'/'.$c->get('request')->getUri()->getPath()); |
|
44 | + $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath() . '/' . $c->get('request')->getUri()->getPath()); |
|
45 | 45 | |
46 | 46 | if (isset($_SESSION['userId'])) { |
47 | 47 | $u = UserQuery::create()->findPk($_SESSION['userId']); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | }; |
55 | 55 | |
56 | 56 | // monolog |
57 | -$container['logger'] = function ($c) { |
|
57 | +$container['logger'] = function($c) { |
|
58 | 58 | $settings = $c->get('settings')['logger']; |
59 | 59 | $logger = new Monolog\Logger($settings['name']); |
60 | 60 | $logger->pushProcessor(new Monolog\Processor\UidProcessor()); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | return $logger; |
64 | 64 | }; |
65 | 65 | |
66 | -$container['auth'] = function ($c) { |
|
66 | +$container['auth'] = function($c) { |
|
67 | 67 | $authConfig = getConfig()['auth']; |
68 | 68 | |
69 | 69 | // full domain e.g. https://example.com |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | break; |
82 | 82 | |
83 | 83 | case 'onebody': |
84 | - $url = $authConfig['onebody']['url'].'/'; |
|
84 | + $url = $authConfig['onebody']['url'] . '/'; |
|
85 | 85 | $email = new EmailAddress($authConfig['onebody']['email']); |
86 | 86 | $apiKey = $authConfig['onebody']['apiKey']; |
87 | 87 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | public function getGroup(ServerRequestInterface $request, ResponseInterface $response, $args) |
14 | 14 | { |
15 | - $this->logger->info("Fetch group GET '/group/".$args['id']."'"); |
|
15 | + $this->logger->info("Fetch group GET '/group/" . $args['id'] . "'"); |
|
16 | 16 | $events = EventQuery::create() |
17 | 17 | ->useEventPersonQuery() |
18 | 18 | ->useUserRoleQuery() |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public function getGroupRoles(ServerRequestInterface $request, ResponseInterface $response, $args) |
40 | 40 | { |
41 | - $this->logger->info("Fetch group roles GET '/group/".$args['id']."/roles'"); |
|
41 | + $this->logger->info("Fetch group roles GET '/group/" . $args['id'] . "/roles'"); |
|
42 | 42 | $events = EventQuery::create() |
43 | 43 | ->useEventPersonQuery() |
44 | 44 | ->useUserRoleQuery() |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | ->findPk($args['id']); |
61 | 61 | |
62 | 62 | // temporary redirect |
63 | - return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').'old/roles.php'); |
|
63 | + return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . 'old/roles.php'); |
|
64 | 64 | |
65 | 65 | return $this->view->render($response, 'group-roles.twig', ['events' => $events, 'group' => $group]); |
66 | 66 | } |
@@ -20,35 +20,35 @@ discard block |
||
20 | 20 | // USER |
21 | 21 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
22 | 22 | |
23 | -$app->group('/user', function () { |
|
24 | - $this->get('s', UserController::class.':getAllUsers')->setName('users'); |
|
23 | +$app->group('/user', function() { |
|
24 | + $this->get('s', UserController::class . ':getAllUsers')->setName('users'); |
|
25 | 25 | |
26 | - $this->get('/{id}/widget-only', UserController::class.':getUserWidgetOnly')->setName('user-widget-only'); |
|
26 | + $this->get('/{id}/widget-only', UserController::class . ':getUserWidgetOnly')->setName('user-widget-only'); |
|
27 | 27 | |
28 | - $this->get('/new', UserController::class.':getNewUserForm')->setName('user-new'); |
|
29 | - $this->get('/{id}/edit', UserController::class.':getUserEditForm')->setName('user-edit'); |
|
30 | - $this->get('/{id}/password', UserController::class.':getUserPasswordForm')->setName('user-password'); |
|
28 | + $this->get('/new', UserController::class . ':getNewUserForm')->setName('user-new'); |
|
29 | + $this->get('/{id}/edit', UserController::class . ':getUserEditForm')->setName('user-edit'); |
|
30 | + $this->get('/{id}/password', UserController::class . ':getUserPasswordForm')->setName('user-password'); |
|
31 | 31 | |
32 | - $this->get('/me', UserController::class.':getCurrentUser')->setName('user-me'); |
|
33 | - $this->get('/{id}', UserController::class.':getUser')->setName('user'); |
|
32 | + $this->get('/me', UserController::class . ':getCurrentUser')->setName('user-me'); |
|
33 | + $this->get('/{id}', UserController::class . ':getUser')->setName('user'); |
|
34 | 34 | |
35 | - $this->post('[/{id}]', UserController::class.':postUser')->setName('user-post'); |
|
36 | - $this->post('/{id}/password', UserController::class.':postUserPasswordChange')->setName('user-password-post'); |
|
35 | + $this->post('[/{id}]', UserController::class . ':postUser')->setName('user-post'); |
|
36 | + $this->post('/{id}/password', UserController::class . ':postUserPasswordChange')->setName('user-password-post'); |
|
37 | 37 | |
38 | 38 | // roles |
39 | - $this->get('/{id}/roles', RoleController::class.':getAssignRolesForm')->setName('user-roles'); |
|
40 | - $this->post('/{id}/roles', RoleController::class.':postUserAssignRoles')->setName('user-assign-post'); |
|
39 | + $this->get('/{id}/roles', RoleController::class . ':getAssignRolesForm')->setName('user-roles'); |
|
40 | + $this->post('/{id}/roles', RoleController::class . ':postUserAssignRoles')->setName('user-assign-post'); |
|
41 | 41 | |
42 | 42 | // availability |
43 | - $this->get('/{id}/availability', AvailabilityController::class.':getAvailabilityForm')->setName('user-availability'); |
|
44 | - $this->post('/{id}/availability', AvailabilityController::class.':postAvailability')->setName('user-availability-post'); |
|
43 | + $this->get('/{id}/availability', AvailabilityController::class . ':getAvailabilityForm')->setName('user-availability'); |
|
44 | + $this->post('/{id}/availability', AvailabilityController::class . ':postAvailability')->setName('user-availability-post'); |
|
45 | 45 | |
46 | 46 | // calendar |
47 | - $this->group('/me/calendar', function () { |
|
48 | - $this->get('s', CalendarController::class.':getCalendarTokens')->setName('user-calendars'); |
|
49 | - $this->get('/new', CalendarController::class.':getNewCalendarForm')->setName('user-calendars'); |
|
50 | - $this->get('/{id}/revoke', CalendarController::class.':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
51 | - $this->post('/new', CalendarController::class.':postNewCalendar')->setName('user-calendar-new-post'); |
|
47 | + $this->group('/me/calendar', function() { |
|
48 | + $this->get('s', CalendarController::class . ':getCalendarTokens')->setName('user-calendars'); |
|
49 | + $this->get('/new', CalendarController::class . ':getNewCalendarForm')->setName('user-calendars'); |
|
50 | + $this->get('/{id}/revoke', CalendarController::class . ':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
51 | + $this->post('/new', CalendarController::class . ':postNewCalendar')->setName('user-calendar-new-post'); |
|
52 | 52 | }); |
53 | 53 | }); |
54 | 54 | |
@@ -56,95 +56,95 @@ discard block |
||
56 | 56 | // EVENT |
57 | 57 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
58 | 58 | |
59 | -$app->group('/event', function () { |
|
60 | - $this->get('s', EventController::class.':getAllEvents')->setName('events'); |
|
61 | - $this->get('s/type/{id}', EventController::class.':getAllEventsWithType')->setName('events-eventtype'); |
|
62 | - $this->get('s/subtype/{id}', EventController::class.':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
59 | +$app->group('/event', function() { |
|
60 | + $this->get('s', EventController::class . ':getAllEvents')->setName('events'); |
|
61 | + $this->get('s/type/{id}', EventController::class . ':getAllEventsWithType')->setName('events-eventtype'); |
|
62 | + $this->get('s/subtype/{id}', EventController::class . ':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
63 | 63 | |
64 | - $this->get('s/print/preachers', EventController::class.':getAllEventsToPrint')->setName('events-print'); |
|
64 | + $this->get('s/print/preachers', EventController::class . ':getAllEventsToPrint')->setName('events-print'); |
|
65 | 65 | |
66 | - $this->get('/new', EventController::class.':getNewEventForm')->setName('event-new'); |
|
67 | - $this->get('/{id}/edit', EventController::class.':getEventEditForm')->setName('event-edit'); |
|
68 | - $this->get('/{id}/copy', EventController::class.':getEventCopyForm')->setName('event-copy'); |
|
69 | - $this->get('/{id}/assign', EventController::class.':getEventAssignForm')->setName('event-assign'); |
|
66 | + $this->get('/new', EventController::class . ':getNewEventForm')->setName('event-new'); |
|
67 | + $this->get('/{id}/edit', EventController::class . ':getEventEditForm')->setName('event-edit'); |
|
68 | + $this->get('/{id}/copy', EventController::class . ':getEventCopyForm')->setName('event-copy'); |
|
69 | + $this->get('/{id}/assign', EventController::class . ':getEventAssignForm')->setName('event-assign'); |
|
70 | 70 | |
71 | - $this->get('/{id}', EventController::class.':getEvent')->setName('event'); |
|
71 | + $this->get('/{id}', EventController::class . ':getEvent')->setName('event'); |
|
72 | 72 | |
73 | - $this->post('[/{id}]', EventController::class.':postEvent')->setName('event-post'); |
|
74 | - $this->post('/{id}/assign', EventController::class.':postEventAssign')->setName('event-assign-post'); |
|
73 | + $this->post('[/{id}]', EventController::class . ':postEvent')->setName('event-post'); |
|
74 | + $this->post('/{id}/assign', EventController::class . ':postEventAssign')->setName('event-assign-post'); |
|
75 | 75 | }); |
76 | 76 | |
77 | 77 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
78 | 78 | // RESOURCE |
79 | 79 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
80 | 80 | |
81 | -$app->group('/resource', function () { |
|
82 | - $this->get('s', ResourceController::class.':getAllResources')->setName('resources'); |
|
81 | +$app->group('/resource', function() { |
|
82 | + $this->get('s', ResourceController::class . ':getAllResources')->setName('resources'); |
|
83 | 83 | |
84 | - $this->get('[/new]', ResourceController::class.':getNewResourceForm')->setName('resource-new'); |
|
85 | - $this->get('/{id}/edit', ResourceController::class.':getResourceEditForm')->setName('resource-edit'); |
|
84 | + $this->get('[/new]', ResourceController::class . ':getNewResourceForm')->setName('resource-new'); |
|
85 | + $this->get('/{id}/edit', ResourceController::class . ':getResourceEditForm')->setName('resource-edit'); |
|
86 | 86 | |
87 | - $this->get('/{id}', ResourceController::class.':getResourceFile')->setName('resource'); |
|
87 | + $this->get('/{id}', ResourceController::class . ':getResourceFile')->setName('resource'); |
|
88 | 88 | |
89 | - $this->post('[/{id}]', ResourceController::class.':postResource')->setName('resource-post'); |
|
89 | + $this->post('[/{id}]', ResourceController::class . ':postResource')->setName('resource-post'); |
|
90 | 90 | }); |
91 | 91 | |
92 | 92 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
93 | 93 | // ROLES & GROUPS |
94 | 94 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
95 | 95 | |
96 | -$app->group('/group', function () { |
|
97 | - $this->get('/{id}', GroupController::class.':getGroup')->setName('group'); |
|
98 | - $this->get('/{id}/roles', GroupController::class.':getGroupRoles')->setName('group-roles'); |
|
96 | +$app->group('/group', function() { |
|
97 | + $this->get('/{id}', GroupController::class . ':getGroup')->setName('group'); |
|
98 | + $this->get('/{id}/roles', GroupController::class . ':getGroupRoles')->setName('group-roles'); |
|
99 | 99 | }); |
100 | 100 | |
101 | 101 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
102 | 102 | // AUTH |
103 | 103 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
104 | 104 | |
105 | -$app->get('/login', AuthController::class.':getLoginForm')->setName('login'); |
|
105 | +$app->get('/login', AuthController::class . ':getLoginForm')->setName('login'); |
|
106 | 106 | |
107 | -$app->get('/login/{provider}', AuthController::class.':getLoginAuth')->setName('login-auth'); |
|
108 | -$app->get('/login/{provider}/callback', AuthController::class.':getLoginCallback')->setName('login-callback'); |
|
109 | -$app->get('/signup', PendingUserController::class.':getSignUpForm')->setName('sign-up'); |
|
110 | -$app->get('/signup/cancel', PendingUserController::class.':getSignUpCancel')->setName('sign-up-cancel'); |
|
107 | +$app->get('/login/{provider}', AuthController::class . ':getLoginAuth')->setName('login-auth'); |
|
108 | +$app->get('/login/{provider}/callback', AuthController::class . ':getLoginCallback')->setName('login-callback'); |
|
109 | +$app->get('/signup', PendingUserController::class . ':getSignUpForm')->setName('sign-up'); |
|
110 | +$app->get('/signup/cancel', PendingUserController::class . ':getSignUpCancel')->setName('sign-up-cancel'); |
|
111 | 111 | |
112 | -$app->get('/logout', AuthController::class.':getLogout')->setName('logout'); |
|
112 | +$app->get('/logout', AuthController::class . ':getLogout')->setName('logout'); |
|
113 | 113 | |
114 | -$app->post('/login', AuthController::class.':postLogin')->setName('login-post'); |
|
115 | -$app->post('/signup', PendingUserController::class.':postSignUp')->setName('sign-up-post'); |
|
114 | +$app->post('/login', AuthController::class . ':postLogin')->setName('login-post'); |
|
115 | +$app->post('/signup', PendingUserController::class . ':postSignUp')->setName('sign-up-post'); |
|
116 | 116 | |
117 | 117 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
118 | 118 | // NOTIFICATIONS |
119 | 119 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
120 | 120 | |
121 | -$app->get('/notification/{id}[/{referrer}]', NotificationController::class.':getNotificationClick')->setName('notification'); |
|
121 | +$app->get('/notification/{id}[/{referrer}]', NotificationController::class . ':getNotificationClick')->setName('notification'); |
|
122 | 122 | |
123 | 123 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
124 | 124 | // CALENDAR |
125 | 125 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
126 | 126 | |
127 | -$app->get('/calendar/{token}.{format}', CalendarController::class.':getRenderedCalendar')->setName('user-calendar'); |
|
127 | +$app->get('/calendar/{token}.{format}', CalendarController::class . ':getRenderedCalendar')->setName('user-calendar'); |
|
128 | 128 | |
129 | 129 | // legacy |
130 | -$app->get('/calendar.php', CalendarController::class.':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
130 | +$app->get('/calendar.php', CalendarController::class . ':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
131 | 131 | |
132 | 132 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
133 | 133 | // OTHER |
134 | 134 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
135 | 135 | |
136 | -$app->get('/settings', function ($request, $response, $args) { |
|
136 | +$app->get('/settings', function($request, $response, $args) { |
|
137 | 137 | // Sample log message |
138 | 138 | $this->logger->info("Fetch settings GET '/settings'"); |
139 | 139 | |
140 | 140 | return $this->view->render($response, 'settings.twig', []); |
141 | 141 | })->setName('settings'); |
142 | 142 | |
143 | -$app->get('/token', function ($request, $response, $args) { |
|
143 | +$app->get('/token', function($request, $response, $args) { |
|
144 | 144 | return $response->getBody()->write(Crypt::generateToken(30)); |
145 | 145 | })->setName('token'); |
146 | 146 | |
147 | -$app->get('/', function ($request, $response, $args) { |
|
147 | +$app->get('/', function($request, $response, $args) { |
|
148 | 148 | // Sample log message |
149 | 149 | $this->logger->info("Fetch home GET '/'"); |
150 | 150 |