| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | } | 
| 7 | 7 | |
| 8 | 8 |  if (isset($_GET['filter'])) { | 
| 9 | -    header('Location: ../events/type/'.(int) $_GET['filter']); | |
| 9 | +    header('Location: ../events/type/' . (int) $_GET['filter']); | |
| 10 | 10 | exit; | 
| 11 | 11 | } | 
| 12 | 12 | |
| @@ -22,35 +22,35 @@ discard block | ||
| 22 | 22 | // USER | 
| 23 | 23 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 24 | 24 | |
| 25 | -$app->group('/user', function () { | |
| 26 | -    $this->get('s', UserController::class.':getAllUsers')->setName('users'); | |
| 25 | +$app->group('/user', function() { | |
| 26 | +    $this->get('s', UserController::class . ':getAllUsers')->setName('users'); | |
| 27 | 27 | |
| 28 | -    $this->get('/{id}/widget-only', UserController::class.':getUserWidgetOnly')->setName('user-widget-only'); | |
| 28 | +    $this->get('/{id}/widget-only', UserController::class . ':getUserWidgetOnly')->setName('user-widget-only'); | |
| 29 | 29 | |
| 30 | -    $this->get('/new', UserController::class.':getNewUserForm')->setName('user-new'); | |
| 31 | -    $this->get('/{id}/edit', UserController::class.':getUserEditForm')->setName('user-edit'); | |
| 32 | -    $this->get('/{id}/password', UserController::class.':getUserPasswordForm')->setName('user-password'); | |
| 30 | +    $this->get('/new', UserController::class . ':getNewUserForm')->setName('user-new'); | |
| 31 | +    $this->get('/{id}/edit', UserController::class . ':getUserEditForm')->setName('user-edit'); | |
| 32 | +    $this->get('/{id}/password', UserController::class . ':getUserPasswordForm')->setName('user-password'); | |
| 33 | 33 | |
| 34 | -    $this->get('/me', UserController::class.':getCurrentUser')->setName('user-me'); | |
| 35 | -    $this->get('/{id}', UserController::class.':getUser')->setName('user'); | |
| 34 | +    $this->get('/me', UserController::class . ':getCurrentUser')->setName('user-me'); | |
| 35 | +    $this->get('/{id}', UserController::class . ':getUser')->setName('user'); | |
| 36 | 36 | |
| 37 | -    $this->post('[/{id}]', UserController::class.':postUser')->setName('user-post'); | |
| 38 | -    $this->post('/{id}/password', UserController::class.':postUserPasswordChange')->setName('user-password-post'); | |
| 37 | +    $this->post('[/{id}]', UserController::class . ':postUser')->setName('user-post'); | |
| 38 | +    $this->post('/{id}/password', UserController::class . ':postUserPasswordChange')->setName('user-password-post'); | |
| 39 | 39 | |
| 40 | 40 | // roles | 
| 41 | -    $this->get('/{id}/roles', RoleController::class.':getAssignRolesForm')->setName('user-roles'); | |
| 42 | -    $this->post('/{id}/roles', RoleController::class.':postUserAssignRoles')->setName('user-assign-post'); | |
| 41 | +    $this->get('/{id}/roles', RoleController::class . ':getAssignRolesForm')->setName('user-roles'); | |
| 42 | +    $this->post('/{id}/roles', RoleController::class . ':postUserAssignRoles')->setName('user-assign-post'); | |
| 43 | 43 | |
| 44 | 44 | // availability | 
| 45 | -    $this->get('/{id}/availability', AvailabilityController::class.':getAvailabilityForm')->setName('user-availability'); | |
| 46 | -    $this->post('/{id}/availability', AvailabilityController::class.':postAvailability')->setName('user-availability-post'); | |
| 45 | +    $this->get('/{id}/availability', AvailabilityController::class . ':getAvailabilityForm')->setName('user-availability'); | |
| 46 | +    $this->post('/{id}/availability', AvailabilityController::class . ':postAvailability')->setName('user-availability-post'); | |
| 47 | 47 | |
| 48 | 48 | // calendar | 
| 49 | -    $this->group('/me/calendar', function () { | |
| 50 | -        $this->get('s', CalendarController::class.':getCalendarTokens')->setName('user-calendars'); | |
| 51 | -        $this->get('/new', CalendarController::class.':getNewCalendarForm')->setName('user-calendars'); | |
| 52 | -        $this->get('/{id}/revoke', CalendarController::class.':getRevokeCalendar')->setName('user-calendar-revoke'); | |
| 53 | -        $this->post('/new', CalendarController::class.':postNewCalendar')->setName('user-calendar-new-post'); | |
| 49 | +    $this->group('/me/calendar', function() { | |
| 50 | +        $this->get('s', CalendarController::class . ':getCalendarTokens')->setName('user-calendars'); | |
| 51 | +        $this->get('/new', CalendarController::class . ':getNewCalendarForm')->setName('user-calendars'); | |
| 52 | +        $this->get('/{id}/revoke', CalendarController::class . ':getRevokeCalendar')->setName('user-calendar-revoke'); | |
| 53 | +        $this->post('/new', CalendarController::class . ':postNewCalendar')->setName('user-calendar-new-post'); | |
| 54 | 54 | }); | 
| 55 | 55 | }); | 
| 56 | 56 | |
| @@ -58,104 +58,104 @@ discard block | ||
| 58 | 58 | // EVENT | 
| 59 | 59 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 60 | 60 | |
| 61 | -$app->group('/event', function () { | |
| 62 | -    $this->get('s', EventController::class.':getAllEvents')->setName('events'); | |
| 63 | -    $this->get('s/type/{id}', EventController::class.':getAllEventsWithType')->setName('events-eventtype'); | |
| 64 | -    $this->get('s/subtype/{id}', EventController::class.':getAllEventsWithSubType')->setName('events-eventsubtype'); | |
| 61 | +$app->group('/event', function() { | |
| 62 | +    $this->get('s', EventController::class . ':getAllEvents')->setName('events'); | |
| 63 | +    $this->get('s/type/{id}', EventController::class . ':getAllEventsWithType')->setName('events-eventtype'); | |
| 64 | +    $this->get('s/subtype/{id}', EventController::class . ':getAllEventsWithSubType')->setName('events-eventsubtype'); | |
| 65 | 65 | |
| 66 | -    $this->get('s/print/info', EventController::class.':getAllEventInfoToPrint')->setName('events-print-info'); | |
| 66 | +    $this->get('s/print/info', EventController::class . ':getAllEventInfoToPrint')->setName('events-print-info'); | |
| 67 | 67 | |
| 68 | -    $this->get('/new', EventController::class.':getNewEventForm')->setName('event-new'); | |
| 69 | -    $this->get('/{id}/edit', EventController::class.':getEventEditForm')->setName('event-edit'); | |
| 70 | -    $this->get('/{id}/copy', EventController::class.':getEventCopyForm')->setName('event-copy'); | |
| 71 | -    $this->get('/{id}/assign', EventController::class.':getEventAssignForm')->setName('event-assign'); | |
| 68 | +    $this->get('/new', EventController::class . ':getNewEventForm')->setName('event-new'); | |
| 69 | +    $this->get('/{id}/edit', EventController::class . ':getEventEditForm')->setName('event-edit'); | |
| 70 | +    $this->get('/{id}/copy', EventController::class . ':getEventCopyForm')->setName('event-copy'); | |
| 71 | +    $this->get('/{id}/assign', EventController::class . ':getEventAssignForm')->setName('event-assign'); | |
| 72 | 72 | |
| 73 | -    $this->get('/{id}', EventController::class.':getEvent')->setName('event'); | |
| 73 | +    $this->get('/{id}', EventController::class . ':getEvent')->setName('event'); | |
| 74 | 74 | |
| 75 | -    $this->post('[/{id}]', EventController::class.':postEvent')->setName('event-post'); | |
| 76 | -    $this->post('/{id}/assign', EventController::class.':postEventAssign')->setName('event-assign-post'); | |
| 77 | -    $this->post('/{id}/comment', EventController::class.':postEventComment')->setName('event-comment-post'); | |
| 75 | +    $this->post('[/{id}]', EventController::class . ':postEvent')->setName('event-post'); | |
| 76 | +    $this->post('/{id}/assign', EventController::class . ':postEventAssign')->setName('event-assign-post'); | |
| 77 | +    $this->post('/{id}/comment', EventController::class . ':postEventComment')->setName('event-comment-post'); | |
| 78 | 78 | }); | 
| 79 | 79 | |
| 80 | 80 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 81 | 81 | // RESOURCE | 
| 82 | 82 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 83 | 83 | |
| 84 | -$app->group('/resource', function () { | |
| 85 | -    $this->get('s', ResourceController::class.':getAllResources')->setName('resources'); | |
| 84 | +$app->group('/resource', function() { | |
| 85 | +    $this->get('s', ResourceController::class . ':getAllResources')->setName('resources'); | |
| 86 | 86 | |
| 87 | -    $this->get('[/new]', ResourceController::class.':getNewResourceForm')->setName('resource-new'); | |
| 88 | -    $this->get('/{id}/edit', ResourceController::class.':getResourceEditForm')->setName('resource-edit'); | |
| 87 | +    $this->get('[/new]', ResourceController::class . ':getNewResourceForm')->setName('resource-new'); | |
| 88 | +    $this->get('/{id}/edit', ResourceController::class . ':getResourceEditForm')->setName('resource-edit'); | |
| 89 | 89 | |
| 90 | -    $this->get('/{id}', ResourceController::class.':getResourceFile')->setName('resource'); | |
| 90 | +    $this->get('/{id}', ResourceController::class . ':getResourceFile')->setName('resource'); | |
| 91 | 91 | |
| 92 | -    $this->post('[/{id}]', ResourceController::class.':postResource')->setName('resource-post'); | |
| 92 | +    $this->post('[/{id}]', ResourceController::class . ':postResource')->setName('resource-post'); | |
| 93 | 93 | }); | 
| 94 | 94 | |
| 95 | 95 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 96 | 96 | // ROLES & GROUPS | 
| 97 | 97 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 98 | 98 | |
| 99 | -$app->group('/group', function () { | |
| 100 | -    $this->get('/{id}', GroupController::class.':getGroup')->setName('group'); | |
| 101 | -    $this->get('/{id}/roles', GroupController::class.':getGroupRoles')->setName('group-roles'); | |
| 102 | -    $this->post('/{id}/roles', GroupController::class.':postGroupRoles')->setName('group-roles-post'); | |
| 99 | +$app->group('/group', function() { | |
| 100 | +    $this->get('/{id}', GroupController::class . ':getGroup')->setName('group'); | |
| 101 | +    $this->get('/{id}/roles', GroupController::class . ':getGroupRoles')->setName('group-roles'); | |
| 102 | +    $this->post('/{id}/roles', GroupController::class . ':postGroupRoles')->setName('group-roles-post'); | |
| 103 | 103 | |
| 104 | -    $this->get('/{id}/events', EventController::class.':getAllEventsToPrintForGroup')->setName('group-events-print'); | |
| 104 | +    $this->get('/{id}/events', EventController::class . ':getAllEventsToPrintForGroup')->setName('group-events-print'); | |
| 105 | 105 | |
| 106 | -    $this->post('[/{id}]', GroupController::class.':postGroup')->setName('group-post'); | |
| 106 | +    $this->post('[/{id}]', GroupController::class . ':postGroup')->setName('group-post'); | |
| 107 | 107 | }); | 
| 108 | 108 | |
| 109 | 109 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 110 | 110 | // AUTH | 
| 111 | 111 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 112 | 112 | |
| 113 | -$app->get('/login', AuthController::class.':getLoginForm')->setName('login'); | |
| 113 | +$app->get('/login', AuthController::class . ':getLoginForm')->setName('login'); | |
| 114 | 114 | |
| 115 | -$app->get('/login/{provider}', AuthController::class.':getLoginAuth')->setName('login-auth'); | |
| 116 | -$app->get('/login/{provider}/callback', AuthController::class.':getLoginCallback')->setName('login-callback'); | |
| 117 | -$app->get('/signup', PendingUserController::class.':getSignUpForm')->setName('sign-up'); | |
| 118 | -$app->get('/signup/cancel', PendingUserController::class.':getSignUpCancel')->setName('sign-up-cancel'); | |
| 115 | +$app->get('/login/{provider}', AuthController::class . ':getLoginAuth')->setName('login-auth'); | |
| 116 | +$app->get('/login/{provider}/callback', AuthController::class . ':getLoginCallback')->setName('login-callback'); | |
| 117 | +$app->get('/signup', PendingUserController::class . ':getSignUpForm')->setName('sign-up'); | |
| 118 | +$app->get('/signup/cancel', PendingUserController::class . ':getSignUpCancel')->setName('sign-up-cancel'); | |
| 119 | 119 | |
| 120 | -$app->get('/logout', AuthController::class.':getLogout')->setName('logout'); | |
| 120 | +$app->get('/logout', AuthController::class . ':getLogout')->setName('logout'); | |
| 121 | 121 | |
| 122 | -$app->post('/login', AuthController::class.':postLogin')->setName('login-post'); | |
| 123 | -$app->post('/signup', PendingUserController::class.':postSignUp')->setName('sign-up-post'); | |
| 122 | +$app->post('/login', AuthController::class . ':postLogin')->setName('login-post'); | |
| 123 | +$app->post('/signup', PendingUserController::class . ':postSignUp')->setName('sign-up-post'); | |
| 124 | 124 | |
| 125 | 125 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 126 | 126 | // NOTIFICATIONS | 
| 127 | 127 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 128 | 128 | |
| 129 | -$app->get('/notification/{id}[/{referrer}]', NotificationController::class.':getNotificationClick')->setName('notification'); | |
| 129 | +$app->get('/notification/{id}[/{referrer}]', NotificationController::class . ':getNotificationClick')->setName('notification'); | |
| 130 | 130 | |
| 131 | 131 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 132 | 132 | // CALENDAR | 
| 133 | 133 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 134 | 134 | |
| 135 | -$app->get('/calendar/{token}.{format}', CalendarController::class.':getRenderedCalendar')->setName('user-calendar'); | |
| 135 | +$app->get('/calendar/{token}.{format}', CalendarController::class . ':getRenderedCalendar')->setName('user-calendar'); | |
| 136 | 136 | |
| 137 | 137 | // legacy | 
| 138 | -$app->get('/calendar.php', CalendarController::class.':getLegacyRenderedCalendar')->setName('user-calendar'); | |
| 138 | +$app->get('/calendar.php', CalendarController::class . ':getLegacyRenderedCalendar')->setName('user-calendar'); | |
| 139 | 139 | |
| 140 | 140 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 141 | 141 | // OTHER | 
| 142 | 142 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 143 | 143 | |
| 144 | -$app->get('/settings', function ($request, $response, $args) { | |
| 144 | +$app->get('/settings', function($request, $response, $args) { | |
| 145 | 145 | // Sample log message | 
| 146 | 146 |      $this->logger->info("Fetch settings GET '/settings'"); | 
| 147 | 147 | |
| 148 | -    $url = $this->router->pathFor('home').'old/settings.php'; | |
| 148 | +    $url = $this->router->pathFor('home') . 'old/settings.php'; | |
| 149 | 149 | |
| 150 | 150 |      return $response->withStatus(303)->withHeader('Location', $url); | 
| 151 | 151 | //return $this->view->render($response, 'settings.twig', []); | 
| 152 | 152 |  })->setName('settings'); | 
| 153 | 153 | |
| 154 | -$app->get('/token', function ($request, $response, $args) { | |
| 154 | +$app->get('/token', function($request, $response, $args) { | |
| 155 | 155 | return $response->getBody()->write(Crypt::generateToken(30)); | 
| 156 | 156 |  })->setName('token'); | 
| 157 | 157 | |
| 158 | -$app->get('/', function ($request, $response, $args) { | |
| 158 | +$app->get('/', function($request, $response, $args) { | |
| 159 | 159 | // Sample log message | 
| 160 | 160 |      $this->logger->info("Fetch home GET '/'"); | 
| 161 | 161 | |
| @@ -175,21 +175,21 @@ discard block | ||
| 175 | 175 | // INSTALL | 
| 176 | 176 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 177 | 177 | |
| 178 | -$app->group('/install', function () { | |
| 179 | -    $this->get('', InstallController::class.':getInstall')->setName('install'); | |
| 178 | +$app->group('/install', function() { | |
| 179 | +    $this->get('', InstallController::class . ':getInstall')->setName('install'); | |
| 180 | 180 | |
| 181 | -    $this->get('/database', InstallController::class.':getInstallDatabase')->setName('install-database'); | |
| 181 | +    $this->get('/database', InstallController::class . ':getInstallDatabase')->setName('install-database'); | |
| 182 | 182 | |
| 183 | -    $this->get('/user', InstallController::class.':getFirstUserForm')->setName('install-user'); | |
| 184 | -    $this->post('/user', InstallController::class.':postFirstUserForm')->setName('install-user-post'); | |
| 183 | +    $this->get('/user', InstallController::class . ':getFirstUserForm')->setName('install-user'); | |
| 184 | +    $this->post('/user', InstallController::class . ':postFirstUserForm')->setName('install-user-post'); | |
| 185 | 185 | }); | 
| 186 | 186 | |
| 187 | 187 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 188 | 188 | // JOBS | 
| 189 | 189 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| 190 | 190 | |
| 191 | -$app->group('/job', function () { | |
| 192 | -    $this->get('/daily/{token}', JobController::class.':getDaily')->setName('job-daily'); | |
| 191 | +$app->group('/job', function() { | |
| 192 | +    $this->get('/daily/{token}', JobController::class . ':getDaily')->setName('job-daily'); | |
| 193 | 193 | }); | 
| 194 | 194 | |
| 195 | -require_once __DIR__.'/routes-legacy.php'; | |
| 195 | +require_once __DIR__ . '/routes-legacy.php'; | |
| @@ -15,7 +15,7 @@ discard block | ||
| 15 | 15 |  { | 
| 16 | 16 | public function getGroup(ServerRequestInterface $request, ResponseInterface $response, $args) | 
| 17 | 17 |      { | 
| 18 | -        $this->logger->info("Fetch group GET '/group/".$args['id']."'"); | |
| 18 | +        $this->logger->info("Fetch group GET '/group/" . $args['id'] . "'"); | |
| 19 | 19 | $events = EventQuery::create() | 
| 20 | 20 | ->useEventPersonQuery() | 
| 21 | 21 | ->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 | |
| 43 | 43 | $group = GroupQuery::create() | 
| 44 | 44 | ->findPk($args['id']); | 
| @@ -48,7 +48,7 @@ discard block | ||
| 48 | 48 | |
| 49 | 49 | public function postGroup(ServerRequestInterface $request, ResponseInterface $response, $args) | 
| 50 | 50 |      { | 
| 51 | -        $this->logger->info("Create/edit group POST '/group/".$args['id']."'"); | |
| 51 | +        $this->logger->info("Create/edit group POST '/group/" . $args['id'] . "'"); | |
| 52 | 52 | |
| 53 | 53 | $group = new Group(); | 
| 54 | 54 | |
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | |
| 68 | 68 | public function postGroupRoles(ServerRequestInterface $request, ResponseInterface $response, $args) | 
| 69 | 69 |      { | 
| 70 | -        $this->logger->info("Create/edit group roles POST '/group/".$args['id']."'"); | |
| 70 | +        $this->logger->info("Create/edit group roles POST '/group/" . $args['id'] . "'"); | |
| 71 | 71 | |
| 72 | 72 | $group = GroupQuery::create()->findPk($args['id']); | 
| 73 | 73 | |