From ad360a70fbea6c225b390cba905ebab58e0a5b07 Mon Sep 17 00:00:00 2001
From: Bot
Date: Sun, 5 Feb 2023 18:03:00 +0100
Subject: [PATCH] Require comma at last array element and no single line space
---
.phpcs.xml | 2 +
config/config.default.php | 4 +-
.../2019_06_12_000000_fix_user_languages.php | 4 +-
...me_minutes_and_timestamps_to_schedules.php | 2 +-
includes/controller/angeltypes_controller.php | 12 ++---
.../controller/event_config_controller.php | 2 +-
.../public_dashboard_controller.php | 6 +--
includes/controller/rooms_controller.php | 2 +-
.../controller/shift_entries_controller.php | 16 +++---
includes/controller/shifts_controller.php | 6 +--
includes/controller/shifttypes_controller.php | 8 +--
.../controller/user_angeltypes_controller.php | 14 ++---
.../user_driver_licenses_controller.php | 2 +-
includes/controller/users_controller.php | 8 +--
includes/model/ShiftsFilter.php | 2 +-
includes/model/Shifts_model.php | 6 +--
includes/model/Stats.php | 4 +-
includes/model/User_model.php | 2 +-
includes/pages/admin_active.php | 10 ++--
includes/pages/admin_arrive.php | 38 ++++++-------
includes/pages/admin_free.php | 8 +--
includes/pages/admin_groups.php | 10 ++--
includes/pages/admin_rooms.php | 28 +++++-----
includes/pages/admin_shifts.php | 36 ++++++-------
includes/pages/admin_user.php | 8 +--
includes/pages/guest_login.php | 32 +++++------
includes/pages/schedule/ImportSchedule.php | 2 +-
includes/pages/user_myshifts.php | 2 +-
includes/pages/user_shifts.php | 12 ++---
includes/sys_template.php | 14 ++---
includes/view/AngelTypes_view.php | 48 ++++++++---------
includes/view/EventConfig_view.php | 12 ++---
includes/view/PublicDashboard_view.php | 18 +++----
includes/view/Rooms_view.php | 6 +--
includes/view/ShiftCalendarRenderer.php | 16 +++---
includes/view/ShiftCalendarShiftRenderer.php | 16 +++---
includes/view/ShiftEntry_view.php | 20 +++----
includes/view/ShiftTypes_view.php | 18 +++----
includes/view/ShiftsFilterRenderer.php | 2 +-
includes/view/Shifts_view.php | 14 ++---
includes/view/UserAngelTypes_view.php | 10 ++--
includes/view/UserDriverLicenses_view.php | 8 +--
includes/view/User_view.php | 54 +++++++++----------
src/Controllers/Admin/NewsController.php | 2 +-
src/Controllers/Admin/UserShirtController.php | 2 +-
.../Admin/UserWorkLogController.php | 2 +-
src/Controllers/FeedController.php | 2 +-
src/Controllers/MessagesController.php | 6 +--
src/Controllers/Metrics/Controller.php | 2 +-
src/Controllers/OAuthController.php | 6 +--
src/Controllers/SettingsController.php | 8 +--
src/Helpers/BarChart.php | 2 +-
src/Models/Question.php | 2 +-
.../Controllers/Admin/NewsControllerTest.php | 2 +-
.../Admin/UserWorkLogControllerTest.php | 2 +-
.../Controllers/Metrics/ControllerTest.php | 2 +-
.../Controllers/Metrics/MetricsEngineTest.php | 6 +--
tests/Unit/Controllers/Metrics/StatsTest.php | 4 +-
.../Unit/Controllers/OAuthControllerTest.php | 4 +-
.../PasswordResetControllerTest.php | 2 +-
.../Controllers/SettingsControllerTest.php | 24 ++++-----
tests/Unit/Database/Migration/MigrateTest.php | 2 +-
.../Unit/Events/EventsServiceProviderTest.php | 4 +-
tests/Unit/Events/Listener/OAuth2Test.php | 2 +-
tests/Unit/FakerProvider.php | 2 +-
tests/Unit/Helpers/BarChartTest.php | 2 +-
.../Helpers/DumpServerServiceProviderTest.php | 4 +-
tests/Unit/Helpers/UuidTest.php | 2 +-
.../Unit/Http/SessionServiceProviderTest.php | 4 +-
tests/Unit/Logger/LoggerTest.php | 2 +-
tests/Unit/Models/NewsTest.php | 2 +-
tests/Unit/Models/User/UserTest.php | 6 +--
72 files changed, 329 insertions(+), 327 deletions(-)
diff --git a/.phpcs.xml b/.phpcs.xml
index 0c36fa5b..0821d7a3 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -40,6 +40,8 @@
+
+
/includes
diff --git a/config/config.default.php b/config/config.default.php
index 64fa2e62..b1aff882 100644
--- a/config/config.default.php
+++ b/config/config.default.php
@@ -357,7 +357,7 @@ return [
'name' => env('SESSION_NAME', 'session'),
// Lifetime in days
- 'lifetime' => env('SESSION_LIFETIME', 30)
+ 'lifetime' => env('SESSION_LIFETIME', 30),
],
// IP addresses of reverse proxies that are trusted, can be an array or a comma separated list
@@ -380,7 +380,7 @@ return [
'credits' => [
'Contribution' => 'Please visit [engelsystem/engelsystem](https://github.com/engelsystem/engelsystem) if '
. 'you want to contribute, have found any [bugs](https://github.com/engelsystem/engelsystem/issues) '
- . 'or need help.'
+ . 'or need help.',
],
// var dump server
diff --git a/db/migrations/2019_06_12_000000_fix_user_languages.php b/db/migrations/2019_06_12_000000_fix_user_languages.php
index 72dd4048..d91542ad 100644
--- a/db/migrations/2019_06_12_000000_fix_user_languages.php
+++ b/db/migrations/2019_06_12_000000_fix_user_languages.php
@@ -17,7 +17,7 @@ class FixUserLanguages extends Migration
$connection
->table('users_settings')
->update([
- 'language' => $connection->raw('REPLACE(language, ".UTF-8", "")')
+ 'language' => $connection->raw('REPLACE(language, ".UTF-8", "")'),
]);
}
@@ -30,7 +30,7 @@ class FixUserLanguages extends Migration
$connection
->table('users_settings')
->update([
- 'language' => $connection->raw('CONCAT(language, ".UTF-8")')
+ 'language' => $connection->raw('CONCAT(language, ".UTF-8")'),
]);
}
}
diff --git a/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php b/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php
index 3bd7ae0e..923457f0 100644
--- a/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php
+++ b/db/migrations/2020_11_20_000000_add_name_minutes_and_timestamps_to_schedules.php
@@ -52,7 +52,7 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
$connection->table('schedules')
->update([
- 'shift_type' => $connection->raw('(' . $query->toSql() . ')')
+ 'shift_type' => $connection->raw('(' . $query->toSql() . ')'),
]);
$this->schema->table('schedules', function (Blueprint $table): void {
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index 82ce7cac..75691602 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -68,7 +68,7 @@ function angeltypes_about_controller()
return [
__('Teams/Job description'),
- AngelTypes_about_view($angeltypes, (bool) $user)
+ AngelTypes_about_view($angeltypes, (bool) $user),
];
}
@@ -94,7 +94,7 @@ function angeltype_delete_controller()
return [
sprintf(__('Delete angeltype %s'), $angeltype->name),
- AngelType_delete_view($angeltype)
+ AngelType_delete_view($angeltype),
];
}
@@ -172,7 +172,7 @@ function angeltype_edit_controller()
return [
sprintf(__('Edit %s'), $angeltype->name),
- AngelType_edit_view($angeltype, $supporter_mode)
+ AngelType_edit_view($angeltype, $supporter_mode),
];
}
@@ -226,7 +226,7 @@ function angeltype_controller()
$shiftsFilterRenderer,
$shiftCalendarRenderer,
$tab
- )
+ ),
];
}
@@ -298,7 +298,7 @@ function angeltypes_list_controller()
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype->id]),
icon('eye') . __('view'),
'btn-sm'
- )
+ ),
];
if (auth()->can('admin_angel_types')) {
@@ -346,7 +346,7 @@ function angeltypes_list_controller()
return [
angeltypes_title(),
- AngelTypes_list_view($angeltypes, auth()->can('admin_angel_types'))
+ AngelTypes_list_view($angeltypes, auth()->can('admin_angel_types')),
];
}
diff --git a/includes/controller/event_config_controller.php b/includes/controller/event_config_controller.php
index 3a5cf5e7..24e07df3 100644
--- a/includes/controller/event_config_controller.php
+++ b/includes/controller/event_config_controller.php
@@ -131,6 +131,6 @@ function event_config_edit_controller()
$event_start_date,
$event_end_date,
$teardown_end_date
- )
+ ),
];
}
diff --git a/includes/controller/public_dashboard_controller.php b/includes/controller/public_dashboard_controller.php
index 823f6a86..114a5fd3 100644
--- a/includes/controller/public_dashboard_controller.php
+++ b/includes/controller/public_dashboard_controller.php
@@ -42,7 +42,7 @@ function public_dashboard_controller()
'needed-3-hours' => stats_angels_needed_three_hours($filter),
'needed-night' => stats_angels_needed_for_nightshifts($filter),
'angels-working' => stats_currently_working($filter),
- 'hours-to-work' => stats_hours_to_work($filter)
+ 'hours-to-work' => stats_hours_to_work($filter),
];
$free_shifts_source = Shifts_free(time(), time() + 12 * 60 * 60, $filter);
@@ -57,7 +57,7 @@ function public_dashboard_controller()
return [
__('Public Dashboard'),
- public_dashboard_view($stats, $free_shifts)
+ public_dashboard_view($stats, $free_shifts),
];
}
@@ -112,7 +112,7 @@ function public_dashboard_needed_angels($needed_angels, ShiftsFilter $filter = n
if ($angeltype->show_on_dashboard) {
$result[] = [
'need' => $need,
- 'angeltype_name' => $angeltype->name
+ 'angeltype_name' => $angeltype->name,
];
}
}
diff --git a/includes/controller/rooms_controller.php b/includes/controller/rooms_controller.php
index a5de90b0..429a741e 100644
--- a/includes/controller/rooms_controller.php
+++ b/includes/controller/rooms_controller.php
@@ -54,7 +54,7 @@ function room_controller(): array
return [
$room->name,
- Room_view($room, $shiftsFilterRenderer, $shiftCalendarRenderer)
+ Room_view($room, $shiftsFilterRenderer, $shiftCalendarRenderer),
];
}
diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php
index b8c904b6..fa3f6d95 100644
--- a/includes/controller/shift_entries_controller.php
+++ b/includes/controller/shift_entries_controller.php
@@ -123,7 +123,7 @@ function shift_entry_create_controller_admin(Shift $shift, ?AngelType $angeltype
$room = $shift->room;
return [
ShiftEntry_create_title(),
- ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_select, $signup_user, $users_select)
+ ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_select, $signup_user, $users_select),
];
}
@@ -170,7 +170,7 @@ function shift_entry_create_controller_supporter(Shift $shift, AngelType $angelt
$room = $shift->room;
return [
ShiftEntry_create_title(),
- ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_user, $users_select)
+ ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_user, $users_select),
];
}
@@ -253,7 +253,7 @@ function shift_entry_create_controller_user(Shift $shift, AngelType $angeltype):
$room = $shift->room;
return [
ShiftEntry_create_title(),
- ShiftEntry_create_view_user($shift, $room, $angeltype, $comment)
+ ShiftEntry_create_view_user($shift, $room, $angeltype, $comment),
];
}
@@ -270,7 +270,7 @@ function shift_entry_create_link(Shift $shift, AngelType $angeltype, $params = [
$params = array_merge([
'action' => 'create',
'shift_id' => $shift->id,
- 'angeltype_id' => $angeltype->id
+ 'angeltype_id' => $angeltype->id,
], $params);
return page_link_to('shift_entries', $params);
}
@@ -286,7 +286,7 @@ function shift_entry_create_link_admin(Shift $shift, $params = [])
{
$params = array_merge([
'action' => 'create',
- 'shift_id' => $shift->id
+ 'shift_id' => $shift->id,
], $params);
return page_link_to('shift_entries', $params);
}
@@ -339,13 +339,13 @@ function shift_entry_delete_controller()
if ($user->id == $signout_user->id) {
return [
ShiftEntry_delete_title(),
- ShiftEntry_delete_view($shift, $angeltype, $signout_user)
+ ShiftEntry_delete_view($shift, $angeltype, $signout_user),
];
}
return [
ShiftEntry_delete_title(),
- ShiftEntry_delete_view_admin($shift, $angeltype, $signout_user)
+ ShiftEntry_delete_view_admin($shift, $angeltype, $signout_user),
];
}
@@ -360,7 +360,7 @@ function shift_entry_delete_link($shiftEntry, $params = [])
{
$params = array_merge([
'action' => 'delete',
- 'shift_entry_id' => $shiftEntry['shift_entry_id'] ?? $shiftEntry['id']
+ 'shift_entry_id' => $shiftEntry['shift_entry_id'] ?? $shiftEntry['id'],
], $params);
return page_link_to('shift_entries', $params);
}
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index 054cc33d..d6d8e167 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -215,8 +215,8 @@ function shift_edit_controller()
form_info('', __('This description is for single shifts, otherwise please use the description in shift type.')),
'' . __('Needed angels') . '
',
$angel_types_spinner,
- form_submit('submit', __('Save'))
- ])
+ form_submit('submit', __('Save')),
+ ]),
]
);
}
@@ -338,7 +338,7 @@ function shift_controller()
return [
$shift->shiftType->name,
- Shift_view($shift, $shifttype, $room, $angeltypes, $shift_signup_state)
+ Shift_view($shift, $shifttype, $room, $angeltypes, $shift_signup_state),
];
}
diff --git a/includes/controller/shifttypes_controller.php b/includes/controller/shifttypes_controller.php
index 9e164abd..800034fc 100644
--- a/includes/controller/shifttypes_controller.php
+++ b/includes/controller/shifttypes_controller.php
@@ -34,7 +34,7 @@ function shifttype_delete_controller()
return [
sprintf(__('Delete shifttype %s'), $shifttype->name),
- ShiftType_delete_view($shifttype)
+ ShiftType_delete_view($shifttype),
];
}
@@ -94,7 +94,7 @@ function shifttype_edit_controller()
return [
shifttypes_title(),
- ShiftType_edit_view($name, $description, $shifttype_id)
+ ShiftType_edit_view($name, $description, $shifttype_id),
];
}
@@ -111,7 +111,7 @@ function shifttype_controller()
return [
$shifttype->name,
- ShiftType_view($shifttype)
+ ShiftType_view($shifttype),
];
}
@@ -126,7 +126,7 @@ function shifttypes_list_controller()
return [
shifttypes_title(),
- ShiftTypes_list_view($shifttypes)
+ ShiftTypes_list_view($shifttypes),
];
}
diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php
index ed975dff..4710a50a 100644
--- a/includes/controller/user_angeltypes_controller.php
+++ b/includes/controller/user_angeltypes_controller.php
@@ -88,7 +88,7 @@ function user_angeltypes_delete_all_controller(): array
return [
__('Deny all users'),
- UserAngelTypes_delete_all_view($angeltype)
+ UserAngelTypes_delete_all_view($angeltype),
];
}
@@ -132,7 +132,7 @@ function user_angeltypes_confirm_all_controller(): array
return [
__('Confirm all users'),
- UserAngelTypes_confirm_all_view($angeltype)
+ UserAngelTypes_confirm_all_view($angeltype),
];
}
@@ -182,7 +182,7 @@ function user_angeltype_confirm_controller(): array
return [
__('Confirm angeltype for user'),
- UserAngelType_confirm_view($user_angeltype, $user_source, $angeltype)
+ UserAngelType_confirm_view($user_angeltype, $user_source, $angeltype),
];
}
@@ -275,7 +275,7 @@ function user_angeltype_delete_controller(): array
return [
__('Remove angeltype'),
- UserAngelType_delete_view($user_angeltype, $user_source, $angeltype)
+ UserAngelType_delete_view($user_angeltype, $user_source, $angeltype),
];
}
@@ -334,7 +334,7 @@ function user_angeltype_update_controller(): array
return [
$supporter ? __('Add supporter rights') : __('Remove supporter rights'),
- UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter)
+ UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter),
];
}
@@ -400,7 +400,7 @@ function user_angeltype_add_controller(): array
return [
__('Add user to angeltype'),
- UserAngelType_add_view($angeltype, $users_source, $user_source->id)
+ UserAngelType_add_view($angeltype, $users_source, $user_source->id),
];
}
@@ -451,7 +451,7 @@ function user_angeltype_join_controller(AngelType $angeltype)
return [
sprintf(__('Become a %s'), $angeltype->name),
- UserAngelType_join_view($user, $angeltype)
+ UserAngelType_join_view($user, $angeltype),
];
}
diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php
index a9071a6e..ed279ac7 100644
--- a/includes/controller/user_driver_licenses_controller.php
+++ b/includes/controller/user_driver_licenses_controller.php
@@ -138,6 +138,6 @@ function user_driver_license_edit_controller()
return [
sprintf(__('Edit %s driving license information'), $user_source->name),
- UserDriverLicense_edit_view($user_source, $driverLicense)
+ UserDriverLicense_edit_view($user_source, $driverLicense),
];
}
diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php
index ee88475f..437d6593 100644
--- a/includes/controller/users_controller.php
+++ b/includes/controller/users_controller.php
@@ -92,7 +92,7 @@ function user_delete_controller()
return [
sprintf(__('Delete %s'), $user_source->name),
- User_delete_view($user_source)
+ User_delete_view($user_source),
];
}
@@ -183,7 +183,7 @@ function user_edit_vouchers_controller()
return [
sprintf(__('%s\'s vouchers'), $user_source->name),
- User_edit_vouchers_view($user_source)
+ User_edit_vouchers_view($user_source),
];
}
@@ -257,7 +257,7 @@ function user_controller()
auth()->can('admin_active'),
auth()->can('admin_user_worklog'),
UserWorkLogsForUser($user_source->id)
- )
+ ),
];
}
@@ -330,7 +330,7 @@ function users_list_controller()
ShiftEntry::whereFreeloaded(true)->count(),
State::whereGotShirt(true)->count(),
State::query()->sum('got_voucher')
- )
+ ),
];
}
diff --git a/includes/model/ShiftsFilter.php b/includes/model/ShiftsFilter.php
index 3eddb627..bb75ed7e 100644
--- a/includes/model/ShiftsFilter.php
+++ b/includes/model/ShiftsFilter.php
@@ -52,7 +52,7 @@ class ShiftsFilter
$this->types = $angelTypes;
$this->filled = [
- ShiftsFilter::FILLED_FREE
+ ShiftsFilter::FILLED_FREE,
];
if ($user_shifts_admin) {
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 08a03387..3925460a 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -78,7 +78,7 @@ function Shifts_free($start, $end, ShiftsFilter $filter = null)
$start,
$end,
$start,
- $end
+ $end,
]);
$shifts = collect($shifts);
@@ -238,7 +238,7 @@ function NeededAngeltype_by_Shift_and_Angeltype(Shift $shift, AngelType $angelty
$shift->id,
$angeltype->id,
$shift->id,
- $angeltype->id
+ $angeltype->id,
]
);
}
@@ -564,7 +564,7 @@ function Shift($shift)
'angel_type_id' => $type['angel_type_id'],
'count' => $type['count'],
'restricted' => $type['restricted'],
- 'taken' => $type['taken']
+ 'taken' => $type['taken'],
];
}
$shift->neededAngels = $neededAngels;
diff --git a/includes/model/Stats.php b/includes/model/Stats.php
index 744f21d0..adc4af32 100644
--- a/includes/model/Stats.php
+++ b/includes/model/Stats.php
@@ -133,7 +133,7 @@ function stats_angels_needed_three_hours(ShiftsFilter $filter = null)
' . ($filter ? 'AND shifts.room_id IN (' . implode(',', $filter->getRooms()) . ')' : '') . '
) AS `tmp`', [
$in3hours,
- $in3hours
+ $in3hours,
]);
return $result['count'] ?: '-';
@@ -214,7 +214,7 @@ function stats_angels_needed_for_nightshifts(ShiftsFilter $filter = null)
$night_start,
$night_end,
$night_start,
- $night_end
+ $night_end,
]);
return $result['count'] ?: '-';
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index fd907a6b..b57059d3 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -31,7 +31,7 @@ function User_tshirt_score($userId)
AND `shifts`.`end` < NOW()
GROUP BY `users`.`id`
', $shift_sum_formula), [
- $userId
+ $userId,
]);
if (!isset($result_shifts['tshirt_score'])) {
$result_shifts = ['tshirt_score' => 0];
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index 0103f4d8..2eb6d1de 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -305,7 +305,7 @@ function admin_active()
->count();
$shirt_statistics[] = [
'size' => $size,
- 'given' => $gc
+ 'given' => $gc,
];
}
}
@@ -319,11 +319,11 @@ function admin_active()
form([
form_text('search', __('Search angel:'), $search),
form_checkbox('show_all_shifts', __('Show all shifts'), $show_all_shifts),
- form_submit('submit', __('Search'))
+ form_submit('submit', __('Search')),
], page_link_to('admin_active')),
$set_active == '' ? form([
form_text('count', __('How much angels should be active?'), $count ?: $forced_count),
- form_submit('set_active', __('Preview'))
+ form_submit('set_active', __('Preview')),
]) : $set_active,
$msg . msg(),
table(
@@ -339,7 +339,7 @@ function admin_active()
'active' => __('Active?'),
'force_active' => __('Forced'),
'tshirt' => ($other_goodie ? __('Goodie?') : __('T-shirt?')),
- 'actions' => ''
+ 'actions' => '',
]
),
$matched_users
@@ -348,6 +348,6 @@ function admin_active()
table(array_merge(
(!$other_goodie ? ['size' => __('Size')] : []),
['given' => $other_goodie ? __('Given goodies') : __('Given shirts') ]
- ), $shirt_statistics)
+ ), $shirt_statistics),
]);
}
diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php
index df29f2e0..5767d818 100644
--- a/includes/pages/admin_arrive.php
+++ b/includes/pages/admin_arrive.php
@@ -152,7 +152,7 @@ function admin_arrive()
$arrival_at_day[$day] = [
'day' => $day,
'count' => $count,
- 'sum' => $arrival_sum
+ 'sum' => $arrival_sum,
];
}
@@ -163,7 +163,7 @@ function admin_arrive()
$planned_arrival_at_day[$day] = [
'day' => $day,
'count' => $count,
- 'sum' => $planned_arrival_sum
+ 'sum' => $planned_arrival_sum,
];
}
@@ -174,7 +174,7 @@ function admin_arrive()
$planned_departure_at_day[$day] = [
'day' => $day,
'count' => $count,
- 'sum' => $planned_departure_sum
+ 'sum' => $planned_departure_sum,
];
}
@@ -182,7 +182,7 @@ function admin_arrive()
$msg . msg(),
form([
form_text('search', __('Search'), $search),
- form_submit('submit', __('Search'))
+ form_submit('submit', __('Search')),
], page_link_to('admin_arrive')),
table([
'name' => __('Nickname'),
@@ -190,54 +190,54 @@ function admin_arrive()
'arrived' => __('Arrived?'),
'rendered_arrival_date' => __('Arrival date'),
'rendered_planned_departure_date' => __('Planned departure'),
- 'actions' => ''
+ 'actions' => '',
], $users_matched),
div('row', [
div('col-md-4', [
heading(__('Planned arrival statistics'), 3),
BarChart::render([
'count' => __('arrived'),
- 'sum' => __('arrived sum')
+ 'sum' => __('arrived sum'),
], [
'count' => '#090',
- 'sum' => '#888'
+ 'sum' => '#888',
], $planned_arrival_at_day),
table([
'day' => __('Date'),
'count' => __('Count'),
- 'sum' => __('Sum')
- ], $planned_arrival_at_day)
+ 'sum' => __('Sum'),
+ ], $planned_arrival_at_day),
]),
div('col-md-4', [
heading(__('Arrival statistics'), 3),
BarChart::render([
'count' => __('arrived'),
- 'sum' => __('arrived sum')
+ 'sum' => __('arrived sum'),
], [
'count' => '#090',
- 'sum' => '#888'
+ 'sum' => '#888',
], $arrival_at_day),
table([
'day' => __('Date'),
'count' => __('Count'),
- 'sum' => __('Sum')
- ], $arrival_at_day)
+ 'sum' => __('Sum'),
+ ], $arrival_at_day),
]),
div('col-md-4', [
heading(__('Planned departure statistics'), 3),
BarChart::render([
'count' => __('arrived'),
- 'sum' => __('arrived sum')
+ 'sum' => __('arrived sum'),
], [
'count' => '#090',
- 'sum' => '#888'
+ 'sum' => '#888',
], $planned_departure_at_day),
table([
'day' => __('Date'),
'count' => __('Count'),
- 'sum' => __('Sum')
- ], $planned_departure_at_day)
- ])
- ])
+ 'sum' => __('Sum'),
+ ], $planned_departure_at_day),
+ ]),
+ ]),
]);
}
diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php
index 44388b4d..f698e715 100644
--- a/includes/pages/admin_free.php
+++ b/includes/pages/admin_free.php
@@ -27,7 +27,7 @@ function admin_free()
$angel_types_source = AngelType::all(['id', 'name']);
$angel_types = [
- '' => __('All')
+ '' => __('All'),
];
foreach ($angel_types_source as $angel_type) {
$angel_types[$angel_type->id] = $angel_type->name;
@@ -105,7 +105,7 @@ function admin_free()
'actions' =>
auth()->can('admin_user')
? button(page_link_to('admin_user', ['id' => $usr->id]), icon('pencil') . __('edit'), 'btn-sm')
- : ''
+ : '',
];
}
return page_with_title(admin_free_title(), [
@@ -115,7 +115,7 @@ function admin_free()
div('row', [
form_text('search', __('Search'), $search, null, null, null, 'col'),
form_select('angeltype', __('Angeltype'), $angel_types, $angelType, '', 'col'),
- form_submit('submit', __('Search'))
+ form_submit('submit', __('Search')),
]),
]),
]),
@@ -126,7 +126,7 @@ function admin_free()
'last_shift' => __('Last shift'),
'dect' => __('DECT'),
'email' => __('E-Mail'),
- 'actions' => ''
+ 'actions' => '',
], $free_users_table),
]);
}
diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php
index 80395946..5e46d5ba 100644
--- a/includes/pages/admin_groups.php
+++ b/includes/pages/admin_groups.php
@@ -44,7 +44,7 @@ function admin_groups()
),
icon('pencil') . __('edit'),
'btn-sm'
- )
+ ),
];
}
@@ -52,8 +52,8 @@ function admin_groups()
table([
'name' => __('Name'),
'privileges' => __('Privileges'),
- 'actions' => ''
- ], $groups_table)
+ 'actions' => '',
+ ], $groups_table),
]);
} else {
switch ($request->input('action')) {
@@ -84,7 +84,7 @@ function admin_groups()
form(
$privileges_form,
page_link_to('admin_groups', ['action' => 'save', 'id' => $group->id])
- )
+ ),
]);
} else {
return error('No Group found.', true);
@@ -145,6 +145,6 @@ function groupPrivilegesWithSelected(Group $group): Collection
->orderBy('name')
->get([
'privileges.*',
- 'group_privileges.group_id as selected'
+ 'group_privileges.group_id as selected',
]);
}
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php
index 95241791..3113877b 100644
--- a/includes/pages/admin_rooms.php
+++ b/includes/pages/admin_rooms.php
@@ -37,8 +37,8 @@ function admin_rooms()
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
icon('trash') . __('delete'),
'btn-sm'
- )
- ])
+ ),
+ ]),
];
}
@@ -154,13 +154,13 @@ function admin_rooms()
$angeltypes_count_form = [];
foreach ($angeltypes as $angeltype_id => $angeltypeName) {
$angeltypes_count_form[] = div('col-lg-4 col-md-6 col-xs-6', [
- form_spinner('angeltype_count_' . $angeltype_id, $angeltypeName, $angeltypes_count[$angeltype_id])
+ form_spinner('angeltype_count_' . $angeltype_id, $angeltypeName, $angeltypes_count[$angeltype_id]),
]);
}
return page_with_title(admin_rooms_title(), [
buttons([
- button(page_link_to('admin_rooms'), __('back'), 'back')
+ button(page_link_to('admin_rooms'), __('back'), 'back'),
]),
$msg,
form([
@@ -176,14 +176,14 @@ function admin_rooms()
div('col-md-6', [
div('row', [
div('col-md-12', [
- form_info(__('Needed angels:'))
+ form_info(__('Needed angels:')),
]),
- join($angeltypes_count_form)
- ])
- ])
+ join($angeltypes_count_form),
+ ]),
+ ]),
]),
- form_submit('submit', __('Save'))
- ])
+ form_submit('submit', __('Save')),
+ ]),
], true);
} elseif ($request->input('show') == 'delete') {
if ($request->hasPostData('ack')) {
@@ -213,7 +213,7 @@ function admin_rooms()
return page_with_title(admin_rooms_title(), [
buttons([
- button(page_link_to('admin_rooms'), __('back'), 'back')
+ button(page_link_to('admin_rooms'), __('back'), 'back'),
]),
sprintf(__('Do you want to delete room %s?'), $name),
form([
@@ -225,14 +225,14 @@ function admin_rooms()
return page_with_title(admin_rooms_title(), [
buttons([
- button(page_link_to('admin_rooms', ['show' => 'edit']), __('add'))
+ button(page_link_to('admin_rooms', ['show' => 'edit']), __('add')),
]),
msg(),
table([
'name' => __('Name'),
'dect' => __('DECT'),
'map_url' => __('Map'),
- 'actions' => ''
- ], $rooms)
+ 'actions' => '',
+ ], $rooms),
], true);
}
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index 8ff76b82..806eabf6 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -286,7 +286,7 @@ function admin_shifts()
'room_id' => $rid,
'title' => $title,
'shift_type_id' => $shifttype_id,
- 'description' => $description
+ 'description' => $description,
];
}
@@ -311,7 +311,7 @@ function admin_shifts()
'title' =>
ShiftType_name_render(ShiftType::find($shifttype_id))
. ($shift['title'] ? '
' . $shift['title'] : ''),
- 'needed_angels' => ''
+ 'needed_angels' => '',
];
foreach ($types as $type) {
if (isset($needed_angel_types[$type->id]) && $needed_angel_types[$type->id] > 0) {
@@ -357,10 +357,10 @@ function admin_shifts()
table([
'timeslot' => __('Time and location'),
'title' => __('Type and title'),
- 'needed_angels' => __('Needed angels')
+ 'needed_angels' => __('Needed angels'),
], $shifts_table),
- form_submit('submit', icon('save') . __('Save'))
- ])
+ form_submit('submit', icon('save') . __('Save')),
+ ]),
]);
}
} elseif ($request->hasPostData('submit')) {
@@ -424,7 +424,7 @@ function admin_shifts()
$needed_angel_types[$type->id],
[
'radio-name' => 'angelmode',
- 'radio-value' => 'manually'
+ 'radio-value' => 'manually',
]
)
. '';
@@ -454,10 +454,10 @@ function admin_shifts()
div('col-md-6 col-xl-5', [
div('row', [
div('col-lg-6', [
- form_datetime('start', __('Start'), $start)
+ form_datetime('start', __('Start'), $start),
]),
div('col-lg-6', [
- form_datetime('end', __('End'), $end)
+ form_datetime('end', __('End'), $end),
]),
]),
form_info(__('Mode')),
@@ -475,7 +475,7 @@ function admin_shifts()
'',
[
'radio-name' => 'mode',
- 'radio-value' => 'multi'
+ 'radio-value' => 'multi',
]
),
form_radio(
@@ -496,14 +496,14 @@ function admin_shifts()
'',
[
'radio-name' => 'mode',
- 'radio-value' => 'variable'
+ 'radio-value' => 'variable',
]
),
form_checkbox(
'shift_over_midnight',
__('Create a shift over midnight.'),
$shift_over_midnight
- )
+ ),
]),
div('col-md-6 col-xl-7', [
form_info(__('Needed angels')),
@@ -520,12 +520,12 @@ function admin_shifts()
'manually'
),
div('row', [
- $angel_types
- ])
- ])
+ $angel_types,
+ ]),
+ ]),
]),
- form_submit('preview', icon('search') . __('Preview'))
- ])
+ form_submit('preview', icon('search') . __('Preview')),
+ ]),
]
);
}
@@ -621,7 +621,7 @@ function admin_shifts_history(): string
'end' => __('End'),
'user' => __('User'),
'created_at' => __('Created'),
- 'actions' => ''
- ], $shiftsData)
+ 'actions' => '',
+ ], $shiftsData),
], true);
}
diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php
index 7f2f6874..a62dce01 100644
--- a/includes/pages/admin_user.php
+++ b/includes/pages/admin_user.php
@@ -81,7 +81,7 @@ function admin_user()
$options = [
'1' => __('Yes'),
- '0' => __('No')
+ '0' => __('No'),
];
// Gekommen?
@@ -175,7 +175,7 @@ function admin_user()
}
$html .= buttons([
- button(user_delete_link($user_source->id), icon('trash') . __('delete'), 'btn-danger')
+ button(user_delete_link($user_source->id), icon('trash') . __('delete'), 'btn-danger'),
]);
$html .= '
';
@@ -296,7 +296,7 @@ function admin_user()
}
return page_with_title(__('Edit user'), [
- $html
+ $html,
]);
}
@@ -317,6 +317,6 @@ function changeableGroups($myHighestGroup, $angelId): Collection
->orderBy('name')
->get([
'groups.*',
- 'users_groups.group_id as selected'
+ 'users_groups.group_id as selected',
]);
}
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index 1fcecda3..43a96784 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -394,21 +394,21 @@ function guest_register()
form_info(
'',
__('Use up to 24 letters, numbers, connecting punctuations or spaces for your nickname.')
- )
+ ),
]),
$enable_pronoun ? div('col', [
- form_text('pronoun', __('Pronoun'), $pronoun, false, 15)
+ form_text('pronoun', __('Pronoun'), $pronoun, false, 15),
]) : '',
]),
$enable_user_name ? div('row', [
div('col', [
- form_text('prename', __('First name'), $preName, false, 64, 'given-name')
+ form_text('prename', __('First name'), $preName, false, 64, 'given-name'),
]),
div('col', [
- form_text('lastname', __('Last name'), $lastName, false, 64, 'family-name')
- ])
+ form_text('lastname', __('Last name'), $lastName, false, 64, 'family-name'),
+ ]),
]) : '',
div('row', [
@@ -449,7 +449,7 @@ function guest_register()
]),
$enable_dect ? div('col', [
- form_text('dect', __('DECT'), $dect, false, 40, 'tel-local')
+ form_text('dect', __('DECT'), $dect, false, 40, 'tel-local'),
]) : '',
div('col', [
@@ -458,13 +458,13 @@ function guest_register()
'mobile_show',
__('Show mobile number to other users to contact me'),
$mobile_show
- ) : ''
- ])
+ ) : '',
+ ]),
]),
div('row', [
$enable_password ? div('col', [
- form_password('password', __('Password') . ' ' . entry_required(), 'new-password')
+ form_password('password', __('Password') . ' ' . entry_required(), 'new-password'),
]) : '',
$enable_planned_arrival ? div('col', [
@@ -474,13 +474,13 @@ function guest_register()
$planned_arrival_date,
$buildup_start_date,
$teardown_end_date
- )
+ ),
]) : '',
]),
div('row', [
$enable_password ? div('col', [
- form_password('password2', __('Confirm password') . ' ' . entry_required(), 'new-password')
+ form_password('password2', __('Confirm password') . ' ' . entry_required(), 'new-password'),
]) : '',
div('col', [
@@ -490,7 +490,7 @@ function guest_register()
$tshirt_sizes,
$tshirt_size,
__('Please select...')
- ) : ''
+ ) : '',
]),
]),
@@ -509,12 +509,12 @@ function guest_register()
form_info(
'',
__('Some angel types have to be confirmed later by a supporter at an introduction meeting. You can change your selection in the options section.')
- )
- ])
+ ),
+ ]),
]),
- form_submit('submit', __('Register'))
- ])
+ form_submit('submit', __('Register')),
+ ]),
]);
}
diff --git a/includes/pages/schedule/ImportSchedule.php b/includes/pages/schedule/ImportSchedule.php
index c0fb4158..5c52f807 100644
--- a/includes/pages/schedule/ImportSchedule.php
+++ b/includes/pages/schedule/ImportSchedule.php
@@ -269,7 +269,7 @@ class ImportSchedule extends BaseController
->table('shift_entries')
->select([
'shift_types.name', 'shifts.title', 'angel_types.name AS type', 'rooms.id AS room_id',
- 'shifts.start', 'shifts.end', 'shift_entries.user_id', 'shift_entries.freeloaded'
+ 'shifts.start', 'shifts.end', 'shift_entries.user_id', 'shift_entries.freeloaded',
])
->join('shifts', 'shifts.id', 'shift_entries.shift_id')
->join('schedule_shift', 'shifts.id', 'schedule_shift.shift_id')
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index 7c908f2e..e031535a 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -44,7 +44,7 @@ function user_myshifts()
__('If you reset the key, the url to your iCal- and JSON-export and your atom/rss feed changes! You have to update it in every application using one of these exports.'),
true
),
- button(page_link_to('user_myshifts', ['reset' => 'ack']), __('Continue'), 'btn-danger')
+ button(page_link_to('user_myshifts', ['reset' => 'ack']), __('Continue'), 'btn-danger'),
]);
} elseif ($request->has('edit') && preg_match('/^\d+$/', $request->input('edit'))) {
$shift_entry_id = $request->input('edit');
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 149922dd..0e5ca35b 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -246,12 +246,12 @@ function view_user_shifts()
$filled = [
[
'id' => '1',
- 'name' => __('occupied')
+ 'name' => __('occupied'),
],
[
'id' => '0',
- 'name' => __('free')
- ]
+ 'name' => __('free'),
+ ],
];
$start_day = $shiftsFilter->getStart()->format('Y-m-d');
$start_time = $shiftsFilter->getStart()->format('H:i');
@@ -326,9 +326,9 @@ function view_user_shifts()
'buttons' => button(
public_dashboard_link(),
icon('speedometer2') . __('Public Dashboard')
- )
- ])
- ])
+ ),
+ ]),
+ ]),
]);
}
diff --git a/includes/sys_template.php b/includes/sys_template.php
index db789d87..6fa45248 100644
--- a/includes/sys_template.php
+++ b/includes/sys_template.php
@@ -23,8 +23,8 @@ function stats($label, $number, $style = null)
return div('col stats text-' . $style, [
$label,
div('number', [
- $number
- ])
+ $number,
+ ]),
]);
}
@@ -68,7 +68,7 @@ function tabs($tabs, $selected = 0)
}
return div('', [
'' . join($tab_header) . '
',
- '' . join($tab_content) . '
'
+ '' . join($tab_content) . '
',
]);
}
@@ -202,7 +202,7 @@ function toolbar_dropdown_item(string $href, string $label, bool $active, string
'{icon}' => $icon === null ? '' : '',
'{label}' => $label,
'{active}' => $active ? ' active' : '',
- '{aria}' => $active ? ' aria-current="page"' : ''
+ '{aria}' => $active ? ' aria-current="page"' : '',
]
);
}
@@ -236,7 +236,7 @@ EOT;
[
'{class}' => $active ? ' active' : '',
'{label}' => $label,
- '{submenu}' => join("\n", $submenu)
+ '{submenu}' => join("\n", $submenu),
]
);
}
@@ -304,11 +304,11 @@ function table($columns, $rows_raw, $data = true)
$rows = [];
foreach ($rows_raw as $row) {
$rows[] = [
- 'col' => $row
+ 'col' => $row,
];
}
return render_table([
- 'col' => $columns
+ 'col' => $columns,
], $rows, $data);
}
diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php
index 63947286..6292ec09 100644
--- a/includes/view/AngelTypes_view.php
+++ b/includes/view/AngelTypes_view.php
@@ -67,7 +67,7 @@ function AngelType_delete_view(AngelType $angeltype)
buttons([
button(page_link_to('angeltypes'), icon('x-lg') . __('cancel')),
form_submit('delete', icon('trash') . __('delete'), 'btn-danger', false),
- ])
+ ]),
]),
], true);
}
@@ -83,7 +83,7 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
{
return page_with_title(sprintf(__('Edit %s'), $angeltype->name), [
buttons([
- button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back')
+ button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back'),
]),
msg(),
form([
@@ -128,8 +128,8 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
form_text('contact_name', __('Name'), $angeltype->contact_name),
config('enable_dect') ? form_text('contact_dect', __('DECT'), $angeltype->contact_dect) : '',
form_text('contact_email', __('E-Mail'), $angeltype->contact_email),
- form_submit('submit', __('Save'))
- ])
+ form_submit('submit', __('Save')),
+ ]),
]);
}
@@ -153,7 +153,7 @@ function AngelType_view_buttons(
$user
) {
$buttons = [
- button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back')
+ button(page_link_to('angeltypes'), icon('person-lines-fill') . __('Angeltypes'), 'back'),
];
if ($angeltype->requires_driver_license) {
@@ -250,7 +250,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
),
__('deny'),
'btn-sm'
- )
+ ),
]);
$members_unconfirmed[] = $member;
} elseif ($member->pivot->supporter) {
@@ -260,11 +260,11 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
page_link_to('user_angeltypes', [
'action' => 'update',
'user_angeltype_id' => $member->pivot->id,
- 'supporter' => 0
+ 'supporter' => 0,
]),
icon('person-fill-down') . __('Remove supporter rights'),
'btn-sm'
- )
+ ),
]);
} else {
$member['actions'] = '';
@@ -278,7 +278,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
page_link_to('user_angeltypes', [
'action' => 'update',
'user_angeltype_id' => $member->pivot->id,
- 'supporter' => 1
+ 'supporter' => 1,
]),
icon('person-fill-up') . __('Add supporter rights'),
'btn-sm'
@@ -287,11 +287,11 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
button(
page_link_to('user_angeltypes', [
'action' => 'delete',
- 'user_angeltype_id' => $member->pivot->id
+ 'user_angeltype_id' => $member->pivot->id,
]),
icon('trash') . __('remove'),
'btn-sm'
- )
+ ),
]);
}
$members_confirmed[] = $member;
@@ -301,7 +301,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
return [
$supporters,
$members_confirmed,
- $members_unconfirmed
+ $members_unconfirmed,
];
}
@@ -318,7 +318,7 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a
$headers = [
'name' => __('Nick'),
'dect' => __('DECT'),
- 'actions' => ''
+ 'actions' => '',
];
if ($angeltype->requires_driver_license && ($supporter || $admin_angeltypes)) {
$headers = [
@@ -331,7 +331,7 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a
'has_license_7_5t_truck' => __('7,5t Truck'),
'has_license_12t_truck' => __('12t Truck'),
'has_license_forklift' => __('Forklift'),
- 'actions' => ''
+ 'actions' => '',
];
}
if (!config('enable_dect')) {
@@ -385,7 +385,7 @@ function AngelType_view(
$shiftsFilterRenderer,
$shiftCalendarRenderer
),
- ], $tab)
+ ], $tab),
], true);
}
@@ -399,7 +399,7 @@ function AngelType_view_shifts(AngelType $angeltype, $shiftsFilterRenderer, $shi
{
$shifts = $shiftsFilterRenderer->render(page_link_to('angeltypes', [
'action' => 'view',
- 'angeltype_id' => $angeltype->id
+ 'angeltype_id' => $angeltype->id,
]), ['type' => $angeltype->id]);
$shifts .= $shiftCalendarRenderer->render();
@@ -449,7 +449,7 @@ function AngelType_view_info(
$members_confirmed[] = [
'name' => __('Sum'),
'dect' => count($members_confirmed),
- 'actions' => ''
+ 'actions' => '',
];
}
@@ -457,7 +457,7 @@ function AngelType_view_info(
$members_unconfirmed[] = [
'name' => __('Sum'),
'dect' => count($members_unconfirmed),
- 'actions' => ''
+ 'actions' => '',
];
}
@@ -471,7 +471,7 @@ function AngelType_view_info(
),
__('Add'),
'add'
- )
+ ),
]);
}
$info[] = table($table_headers, $members_confirmed);
@@ -486,7 +486,7 @@ function AngelType_view_info(
button(
page_link_to('user_angeltypes', ['action' => 'delete_all', 'angeltype_id' => $angeltype->id]),
icon('trash') . __('deny all')
- )
+ ),
]);
$info[] = table($table_headers, $members_unconfirmed);
}
@@ -532,15 +532,15 @@ function AngelTypes_list_view($angeltypes, bool $admin_angeltypes)
$admin_angeltypes
? button(page_link_to('angeltypes', ['action' => 'edit']), __('New angeltype'), 'add')
: '',
- button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description'))
+ button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description')),
]),
table([
'name' => __('Name'),
'is_restricted' => icon('mortarboard-fill') . __('Requires introduction'),
'no_self_signup_allowed' => icon('pencil-square') . __('Self Sign Up Allowed'),
'membership' => __('Membership'),
- 'actions' => ''
- ], $angeltypes)
+ 'actions' => '',
+ ], $angeltypes),
], true);
}
@@ -627,7 +627,7 @@ function AngelTypes_about_view($angeltypes, $user_logged_in)
$content = [
buttons($buttons),
'' . __('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '
',
- '
'
+ '
',
];
foreach ($angeltypes as $angeltype) {
$content[] = AngelTypes_about_view_angeltype($angeltype);
diff --git a/includes/view/EventConfig_view.php b/includes/view/EventConfig_view.php
index e02a5ad1..296c0e0a 100644
--- a/includes/view/EventConfig_view.php
+++ b/includes/view/EventConfig_view.php
@@ -31,20 +31,20 @@ function EventConfig_edit_view(
form_info(
'',
__('Welcome message is shown after successful registration. You can use markdown.')
- )
+ ),
]),
div('col-md-3 col-xs-6', [
form_datetime('buildup_start_date', __('Buildup date'), $buildup_start_date),
form_datetime('event_start_date', __('Event start date'), $event_start_date),
form_datetime('event_end_date', __('Event end date'), $event_end_date),
form_datetime('teardown_end_date', __('Teardown end date'), $teardown_end_date),
- ])
+ ]),
]),
div('row', [
div('col-md-6', [
- form_submit('submit', __('Save'))
- ])
- ])
- ])
+ form_submit('submit', __('Save')),
+ ]),
+ ]),
+ ]),
]);
}
diff --git a/includes/view/PublicDashboard_view.php b/includes/view/PublicDashboard_view.php
index aab9682e..eaadb0e2 100644
--- a/includes/view/PublicDashboard_view.php
+++ b/includes/view/PublicDashboard_view.php
@@ -12,7 +12,7 @@ function public_dashboard_view($stats, $free_shifts)
$needed_angels = '';
if (count($free_shifts) > 0) {
$shift_panels = [
- ''
+ '
',
];
foreach ($free_shifts as $i => $shift) {
$shift_panels[] = public_dashboard_shift_render($shift);
@@ -23,11 +23,11 @@ function public_dashboard_view($stats, $free_shifts)
$shift_panels[] = '
';
$needed_angels = div('first', [
div('col-md-12', [
- heading(__('Needed angels:'))
+ heading(__('Needed angels:')),
]),
div('container-fluid', [
- join($shift_panels)
- ])
+ join($shift_panels),
+ ]),
]);
}
@@ -42,7 +42,7 @@ function public_dashboard_view($stats, $free_shifts)
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
], 'statistics'),
- $needed_angels
+ $needed_angels,
], 'public-dashboard'),
]),
div('first col-md-12 text-center', [buttons([
@@ -55,7 +55,7 @@ function public_dashboard_view($stats, $free_shifts)
auth()->user() ? button(
public_dashboard_link($isFiltered ? [] : ['filtered' => 1] + $filter),
icon('filter') . ($isFiltered ? __('All') : __('Filtered'))
- ) : ''
+ ) : '',
])], 'fullscreen-button'),
]);
}
@@ -94,8 +94,8 @@ function public_dashboard_shift_render($shift)
div('dashboard-card card border-' . $shift['style'] . ' ' . $type, [
div('card-body', [
'
',
- $panel_body
- ])
- ])
+ $panel_body,
+ ]),
+ ]),
]);
}
diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php
index 73e7c6de..c7cefde7 100644
--- a/includes/view/Rooms_view.php
+++ b/includes/view/Rooms_view.php
@@ -46,9 +46,9 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
$tabs[__('Shifts')] = div('first', [
$shiftsFilterRenderer->render(page_link_to('rooms', [
'action' => 'view',
- 'room_id' => $room->id
+ 'room_id' => $room->id,
]), ['rooms' => [$room->id]]),
- $shiftCalendarRenderer->render()
+ $shiftCalendarRenderer->render(),
]);
$selected_tab = 0;
@@ -69,7 +69,7 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
icon('trash') . __('delete'),
'btn'
- )
+ ),
]) : '',
$dect,
$description,
diff --git a/includes/view/ShiftCalendarRenderer.php b/includes/view/ShiftCalendarRenderer.php
index eeda6e39..3ad705c7 100644
--- a/includes/view/ShiftCalendarRenderer.php
+++ b/includes/view/ShiftCalendarRenderer.php
@@ -77,7 +77,7 @@ class ShiftCalendarRenderer
if (!isset($lanes[$room->id])) {
// initialize room with one lane
$lanes[$room->id] = [
- new ShiftCalendarLane($header)
+ new ShiftCalendarLane($header),
];
}
// Try to add the shift to the existing lanes for this room
@@ -141,7 +141,7 @@ class ShiftCalendarRenderer
return div('shift-calendar table-responsive', [
$this->renderTimeLane(),
- $this->renderShiftLanes()
+ $this->renderShiftLanes(),
]) . $this->renderLegend();
}
@@ -199,7 +199,7 @@ class ShiftCalendarRenderer
return div('lane', [
div('header ' . $bg, $lane->getHeader()),
- $html
+ $html,
]);
}
@@ -218,14 +218,14 @@ class ShiftCalendarRenderer
return div($class . ' day');
}
return div($class . ' day', [
- date(__('m-d'), $time) . '
' . date(__('H:i'), $time)
+ date(__('m-d'), $time) . '
' . date(__('H:i'), $time),
]);
} elseif ($time % (60 * 60) == 0) {
if (!$label) {
return div($class . ' hour');
}
return div($class . ' hour', [
- date(__('m-d'), $time) . '
' . date(__('H:i'), $time)
+ date(__('m-d'), $time) . '
' . date(__('H:i'), $time),
]);
}
return div($class);
@@ -242,8 +242,8 @@ class ShiftCalendarRenderer
$time_slot = [
div('header ' . $bg, [
- __('Time')
- ])
+ __('Time'),
+ ]),
];
for ($block = 0; $block < $this->getBlocksPerSlot(); $block++) {
$thistime = $this->getFirstBlockStartTime() + ($block * ShiftCalendarRenderer::SECONDS_PER_ROW);
@@ -312,7 +312,7 @@ class ShiftCalendarRenderer
badge(__('Help needed'), 'danger'),
badge(__('Other angeltype needed / collides with my shifts'), 'warning'),
badge(__('Shift is full'), 'success'),
- badge(__('Shift running/ended or user not arrived/allowed'), 'secondary')
+ badge(__('Shift running/ended or user not arrived/allowed'), 'secondary'),
]);
}
}
diff --git a/includes/view/ShiftCalendarShiftRenderer.php b/includes/view/ShiftCalendarShiftRenderer.php
index 72f56f00..3ab89147 100644
--- a/includes/view/ShiftCalendarShiftRenderer.php
+++ b/includes/view/ShiftCalendarShiftRenderer.php
@@ -57,12 +57,12 @@ class ShiftCalendarShiftRenderer
$this->renderShiftHead($shift, $class, $shift_signup_state->getFreeEntries()),
div('card-body ' . $this->classBg(), [
$info_text,
- Room_name_render($room)
+ Room_name_render($room),
]),
- $shifts_row
+ $shifts_row,
]
)
- )
+ ),
];
}
@@ -134,13 +134,13 @@ class ShiftCalendarShiftRenderer
if ($html != '') {
return [
$shift_signup_state,
- '
'
+ '
',
];
}
return [
$shift_signup_state,
- ''
+ '',
];
}
@@ -218,7 +218,7 @@ class ShiftCalendarShiftRenderer
$shifts_row .= '';
return [
$shift_signup_state,
- $shifts_row
+ $shifts_row,
];
}
@@ -257,7 +257,7 @@ class ShiftCalendarShiftRenderer
page_link_to('user_shifts', ['delete_shift' => $shift->id]),
icon('trash'),
'btn-' . $class . ' btn-sm border-light text-white'
- )
+ ),
]) . '
';
}
$shift_heading = $shift->start->format('H:i') . ' ‐ '
@@ -270,7 +270,7 @@ class ShiftCalendarShiftRenderer
return div('card-header d-flex align-items-center', [
'' . $shift_heading . '',
- $header_buttons
+ $header_buttons,
]);
}
}
diff --git a/includes/view/ShiftEntry_view.php b/includes/view/ShiftEntry_view.php
index 1da3ce07..d952ce20 100644
--- a/includes/view/ShiftEntry_view.php
+++ b/includes/view/ShiftEntry_view.php
@@ -28,7 +28,7 @@ function ShiftEntry_delete_view_admin(Shift $shift, AngelType $angeltype, User $
form([
buttons([
button(user_link($signoff_user->id), icon('x-lg') . __('cancel')),
- form_submit('delete', icon('trash') . __('sign off'), 'btn-danger', false)
+ form_submit('delete', icon('trash') . __('sign off'), 'btn-danger', false),
]),
]),
]);
@@ -100,8 +100,8 @@ function ShiftEntry_create_view_admin(
form([
form_select('angeltype_id', __('Angeltype'), $angeltypes_select, $angeltype->id),
form_select('user_id', __('User'), $users_select, $signup_user->id),
- form_submit('submit', icon('check-lg') . __('Save'))
- ])
+ form_submit('submit', icon('check-lg') . __('Save')),
+ ]),
]
);
}
@@ -130,8 +130,8 @@ function ShiftEntry_create_view_supporter(Shift $shift, Room $room, AngelType $a
), true),
form([
form_select('user_id', __('User'), $users_select, $signup_user->id),
- form_submit('submit', icon('check-lg') . __('Save'))
- ])
+ form_submit('submit', icon('check-lg') . __('Save')),
+ ]),
]
);
}
@@ -156,8 +156,8 @@ function ShiftEntry_create_view_user(Shift $shift, Room $room, AngelType $angelt
info(sprintf(__('Do you want to sign up for this shift as %s?'), AngelType_name_render($angeltype)), true),
form([
form_textarea('comment', __('Comment (for your eyes only):'), $comment),
- form_submit('submit', icon('check-lg') . __('Save'))
- ])
+ form_submit('submit', icon('check-lg') . __('Save')),
+ ]),
]
);
}
@@ -203,7 +203,7 @@ function ShiftEntry_edit_view(
'freeloaded_comment',
__('Freeload comment (Only for shift coordination):'),
$freeloaded_comment
- )
+ ),
];
}
@@ -223,7 +223,7 @@ function ShiftEntry_edit_view(
form_info(__('Type:'), $type),
$comment,
join('', $freeload_form),
- form_submit('submit', __('Save'))
- ])
+ form_submit('submit', __('Save')),
+ ]),
]);
}
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php
index aa2133ac..4b7beee5 100644
--- a/includes/view/ShiftTypes_view.php
+++ b/includes/view/ShiftTypes_view.php
@@ -48,14 +48,14 @@ function ShiftType_edit_view($name, $description, $shifttype_id)
return page_with_title($shifttype_id ? __('Edit shifttype') : __('Create shifttype'), [
msg(),
buttons([
- button(page_link_to('shifttypes'), shifttypes_title(), 'back')
+ button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
]),
form([
form_text('name', __('Name'), $name),
form_textarea('description', __('Description'), $description),
form_info('', __('Please use markdown for the description.')),
- form_submit('submit', __('Save'))
- ])
+ form_submit('submit', __('Save')),
+ ]),
], true);
}
@@ -80,10 +80,10 @@ function ShiftType_view(ShiftType $shifttype)
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype->id]),
icon('trash') . __('delete'),
'delete'
- )
+ ),
]),
heading(__('Description'), 2),
- $parsedown->parse($shifttype->description)
+ $parsedown->parse($shifttype->description),
], true);
}
@@ -112,18 +112,18 @@ function ShiftTypes_list_view($shifttypes)
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype->id]),
icon('trash') . __('delete'),
'btn-sm'
- )
+ ),
]);
}
return page_with_title(shifttypes_title(), [
msg(),
buttons([
- button(page_link_to('shifttypes', ['action' => 'edit']), __('New shifttype'), 'add')
+ button(page_link_to('shifttypes', ['action' => 'edit']), __('New shifttype'), 'add'),
]),
table([
'name' => __('Name'),
- 'actions' => ''
- ], $shifttypes)
+ 'actions' => '',
+ ], $shifttypes),
], true);
}
diff --git a/includes/view/ShiftsFilterRenderer.php b/includes/view/ShiftsFilterRenderer.php
index 0e1761ac..f8af0b73 100644
--- a/includes/view/ShiftsFilterRenderer.php
+++ b/includes/view/ShiftsFilterRenderer.php
@@ -72,7 +72,7 @@ class ShiftsFilterRenderer
}
}
return div('mb-3', [
- toolbar_pills($toolbar)
+ toolbar_pills($toolbar),
]);
}
diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php
index 67a72acf..8717b9c1 100644
--- a/includes/view/Shifts_view.php
+++ b/includes/view/Shifts_view.php
@@ -26,7 +26,7 @@ function Shift_view_header(Shift $shift, Room $room)
. ($shift->url != ''
? '' . $shift->title . ''
: $shift->title)
- . '
'
+ . '',
]),
div('col-sm-3 col-xs-6', [
'' . __('Start') . '
',
@@ -34,7 +34,7 @@ function Shift_view_header(Shift $shift, Room $room)
icon('calendar-event') . $shift->start->format(__('Y-m-d')),
'
',
icon('clock') . $shift->start->format('H:i'),
- ''
+ '',
]),
div('col-sm-3 col-xs-6', [
'' . __('End') . '
',
@@ -42,12 +42,12 @@ function Shift_view_header(Shift $shift, Room $room)
icon('calendar-event') . $shift->end->format(__('Y-m-d')),
'
',
icon('clock') . $shift->end->format('H:i'),
- ''
+ '',
]),
div('col-sm-3 col-xs-6', [
'' . __('Location') . '
',
- '' . Room_name_render($room) . '
'
- ])
+ '' . Room_name_render($room) . '
',
+ ]),
]);
}
@@ -184,13 +184,13 @@ function Shift_view(Shift $shift, ShiftType $shifttype, Room $room, $angeltypes_
$content[] = div('row', [
div('col-sm-6', [
'' . __('Needed angels') . '
',
- '' . $needed_angels . '
'
+ '' . $needed_angels . '
',
]),
div('col-sm-6', [
'' . __('Description') . '
',
$parsedown->parse($shifttype->description),
$parsedown->parse($shift->description),
- ])
+ ]),
]);
if ($shift_admin) {
diff --git a/includes/view/UserAngelTypes_view.php b/includes/view/UserAngelTypes_view.php
index 1492107a..330c3454 100644
--- a/includes/view/UserAngelTypes_view.php
+++ b/includes/view/UserAngelTypes_view.php
@@ -56,7 +56,7 @@ function UserAngelTypes_delete_all_view(AngelType $angeltype)
),
icon('x-lg') . __('cancel')
),
- form_submit('deny_all', icon('check-lg') . __('yes'), 'btn-primary', false)
+ form_submit('deny_all', icon('check-lg') . __('yes'), 'btn-primary', false),
]),
], page_link_to('user_angeltypes', ['action' => 'delete_all', 'angeltype_id' => $angeltype->id])),
]);
@@ -148,14 +148,14 @@ function UserAngelType_add_view(AngelType $angeltype, $users_source, $user_id)
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype->id]),
__('back'),
'back'
- )
+ ),
]),
form([
form_info(__('Angeltype'), $angeltype->name),
form_checkbox('auto_confirm_user', __('Confirm user'), true),
form_select('user_id', __('User'), $users, $user_id),
- form_submit('submit', __('Add'))
- ])
+ form_submit('submit', __('Add')),
+ ]),
]);
}
@@ -177,7 +177,7 @@ function UserAngelType_join_view($user, AngelType $angeltype)
auth()->can('admin_user_angeltypes') ? form_checkbox('auto_confirm_user', __('Confirm user'), true) : '',
buttons([
button(angeltype_link($angeltype->id), icon('x-lg') . __('cancel')),
- form_submit('submit', icon('check-lg') . __('save'), 'btn-primary', false)
+ form_submit('submit', icon('check-lg') . __('save'), 'btn-primary', false),
]),
], page_link_to(
'user_angeltypes',
diff --git a/includes/view/UserDriverLicenses_view.php b/includes/view/UserDriverLicenses_view.php
index f32f4f2f..d7e2850f 100644
--- a/includes/view/UserDriverLicenses_view.php
+++ b/includes/view/UserDriverLicenses_view.php
@@ -14,7 +14,7 @@ function UserDriverLicense_edit_view($user_source, $user_driver_license)
{
return page_with_title(sprintf(__('Edit %s driving license information'), User_Nick_render($user_source)), [
buttons([
- button(user_link($user_source->id), __('Back to profile'), 'back')
+ button(user_link($user_source->id), __('Back to profile'), 'back'),
]),
msg(),
form([
@@ -47,9 +47,9 @@ function UserDriverLicense_edit_view($user_source, $user_driver_license)
'has_license_forklift',
__('Forklift'),
$user_driver_license->drive_forklift
- )
+ ),
], 'driving_license'),
- form_submit('submit', __('Save'))
+ form_submit('submit', __('Save')),
]),
'
- '
+ ',
], true);
}
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 076c5742..18e530bc 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -21,7 +21,7 @@ function User_delete_view($user)
return page_with_title(sprintf(__('Delete %s'), User_Nick_render($user)), [
msg(),
buttons([
- button(user_edit_link($user->id), icon('chevron-left') . __('back'))
+ button(user_edit_link($user->id), icon('chevron-left') . __('back')),
]),
error(
__('Do you really want to delete the user including all his shifts and every other piece of his data?'),
@@ -29,8 +29,8 @@ function User_delete_view($user)
),
form([
form_password('password', __('Your password'), 'current-password'),
- form_submit('submit', __('Delete'))
- ])
+ form_submit('submit', __('Delete')),
+ ]),
]);
}
@@ -45,7 +45,7 @@ function User_edit_vouchers_view($user)
return page_with_title(sprintf(__('%s\'s vouchers'), User_Nick_render($user)), [
msg(),
buttons([
- button(user_link($user->id), icon('chevron-left') . __('back'))
+ button(user_link($user->id), icon('chevron-left') . __('back')),
]),
info(sprintf(
$user->state->force_active
@@ -56,10 +56,10 @@ function User_edit_vouchers_view($user)
form(
[
form_spinner('vouchers', __('Number of vouchers given out'), $user->state->got_voucher),
- form_submit('submit', __('Save'))
+ form_submit('submit', __('Save')),
],
page_link_to('users', ['action' => 'edit_vouchers', 'user_id' => $user->id])
- )
+ ),
]);
}
@@ -110,7 +110,7 @@ function Users_view(
? $user->personalData->planned_departure_date->format(__('Y-m-d')) : '';
$u['last_login_at'] = $user->last_login_at ? $user->last_login_at->format(__('m/d/Y h:i a')) : '';
$u['actions'] = table_buttons([
- button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil', 'btn-sm')
+ button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil', 'btn-sm'),
]);
$usersList[] = $u;
}
@@ -122,11 +122,11 @@ function Users_view(
'force_active' => $force_active_count,
'freeloads' => $freeloads_count,
'got_shirt' => $tshirts_count,
- 'actions' => '' . count($usersList) . ''
+ 'actions' => '' . count($usersList) . '',
];
$user_table_headers = [
- 'name' => Users_table_header_link('name', __('Nick'), $order_by)
+ 'name' => Users_table_header_link('name', __('Nick'), $order_by),
];
if (config('enable_user_name')) {
$user_table_headers['first_name'] = Users_table_header_link('first_name', __('Prename'), $order_by);
@@ -172,9 +172,9 @@ function Users_view(
return page_with_title(__('All users'), [
msg(),
buttons([
- button(page_link_to('register'), icon('plus-lg') . __('New user'))
+ button(page_link_to('register'), icon('plus-lg') . __('New user')),
]),
- table($user_table_headers, $usersList)
+ table($user_table_headers, $usersList),
]);
}
@@ -312,7 +312,7 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
'duration' => sprintf('%.2f', ($shift->end->timestamp - $shift->start->timestamp) / 3600) . ' h',
'room' => Room_name_render($shift->room),
'shift_info' => $shift_info,
- 'comment' => ''
+ 'comment' => '',
];
if ($its_me) {
@@ -332,7 +332,7 @@ function User_view_myshift(Shift $shift, $user_source, $its_me)
}
$myshift['actions'] = [
- button(shift_link($shift), icon('eye') . __('view'), 'btn-sm')
+ button(shift_link($shift), icon('eye') . __('view'), 'btn-sm'),
];
if ($its_me || auth()->can('user_shifts_admin')) {
$myshift['actions'][] = button(
@@ -403,7 +403,7 @@ function User_view_myshifts(
'room' => '',
'shift_info' => '',
'comment' => '',
- 'actions' => ''
+ 'actions' => '',
];
if (config('enable_tshirt_size', false) && ($its_me || $tshirt_admin)) {
$myshifts_table[] = [
@@ -412,7 +412,7 @@ function User_view_myshifts(
'room' => '',
'shift_info' => '',
'comment' => '',
- 'actions' => ''
+ 'actions' => '',
];
}
}
@@ -440,7 +440,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
url('/admin/user/' . $worklog->user->id . '/worklog/' . $worklog->id . '/delete'),
icon('trash') . __('delete'),
'btn-sm'
- )
+ ),
]);
}
@@ -455,7 +455,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
User_Nick_render($worklog->creator),
$worklog->created_at->format('Y-m-d H:i')
),
- 'actions' => $actions
+ 'actions' => $actions,
];
}
@@ -512,7 +512,7 @@ function User_view(
'room' => __('Location'),
'shift_info' => __('Name & workmates'),
'comment' => __('Comment'),
- 'actions' => __('Action')
+ 'actions' => __('Action'),
], $my_shifts);
} elseif ($user_source->state->force_active) {
$myshifts_table = success(__('You have done enough.'), true);
@@ -554,7 +554,7 @@ function User_view(
form([
form_hidden('action', 'arrived'),
form_hidden('user', $user_source->id),
- form_submit('submit', __('arrived'), '', false)
+ form_submit('submit', __('arrived'), '', false),
], page_link_to('admin_arrive'), true) : '',
($admin_user_privilege || $auth->can('voucher.edit')) && config('enable_voucher') ?
button(
@@ -588,9 +588,9 @@ function User_view(
)) ? button(
page_link_to('user_myshifts', ['reset' => 1]),
icon('arrow-repeat') . __('Reset API key')
- ) : ''
- ])
- ])
+ ) : '',
+ ]),
+ ]),
]),
div('row user-info', [
div('col-md-2', [
@@ -641,7 +641,7 @@ function User_view(
page_link_to('user_shifts')
), true)
: '',
- $its_me ? ical_hint() : ''
+ $its_me ? ical_hint() : '',
]
);
}
@@ -664,7 +664,7 @@ function User_view_state($admin_user_privilege, $freeloader, $user_source)
return div('col-md-2', [
heading(__('User state'), 4),
- join('
', $state)
+ join('
', $state),
]);
}
@@ -677,7 +677,7 @@ function User_view_state($admin_user_privilege, $freeloader, $user_source)
function User_view_state_user($user_source)
{
$state = [
- User_shift_state_render($user_source)
+ User_shift_state_render($user_source),
];
if ($user_source->state->arrived) {
@@ -771,7 +771,7 @@ function User_angeltypes_render($user_angeltypes)
}
return div('col-md-2', [
heading(__('Angeltypes'), 4),
- join('
', $output)
+ join('
', $output),
]);
}
@@ -788,7 +788,7 @@ function User_groups_render($user_groups)
return div('col-md-2', [
'' . __('Rights') . '
',
- join('
', $output)
+ join('
', $output),
]);
}
diff --git a/src/Controllers/Admin/NewsController.php b/src/Controllers/Admin/NewsController.php
index 33516952..6d94760d 100644
--- a/src/Controllers/Admin/NewsController.php
+++ b/src/Controllers/Admin/NewsController.php
@@ -76,7 +76,7 @@ class NewsController extends BaseController
'Deleted {type} "{news}"',
[
'type' => $news->is_meeting ? 'meeting' : 'news',
- 'news' => $news->title
+ 'news' => $news->title,
]
);
diff --git a/src/Controllers/Admin/UserShirtController.php b/src/Controllers/Admin/UserShirtController.php
index 497d99be..fef1ee15 100644
--- a/src/Controllers/Admin/UserShirtController.php
+++ b/src/Controllers/Admin/UserShirtController.php
@@ -83,7 +83,7 @@ class UserShirtController extends BaseController
'size' => $user->personalData->shirt_size,
'arrived' => $user->state->arrived ? 'yes' : 'no',
'active' => $user->state->active ? 'yes' : 'no',
- 'got_shirt' => $user->state->got_shirt ? 'yes' : 'no'
+ 'got_shirt' => $user->state->got_shirt ? 'yes' : 'no',
]
);
diff --git a/src/Controllers/Admin/UserWorkLogController.php b/src/Controllers/Admin/UserWorkLogController.php
index 44e98386..d13357bf 100644
--- a/src/Controllers/Admin/UserWorkLogController.php
+++ b/src/Controllers/Admin/UserWorkLogController.php
@@ -105,7 +105,7 @@ class UserWorkLogController extends BaseController
return $this->response->withView(
'admin/user/delete-worklog.twig',
- [ 'user' => $user ]
+ ['user' => $user]
);
}
diff --git a/src/Controllers/FeedController.php b/src/Controllers/FeedController.php
index d44ad723..6be7ca50 100644
--- a/src/Controllers/FeedController.php
+++ b/src/Controllers/FeedController.php
@@ -117,7 +117,7 @@ class FeedController extends BaseController
...$entry->toArray(),
// Fahrplan app required data
- ...$data
+ ...$data,
];
}
diff --git a/src/Controllers/MessagesController.php b/src/Controllers/MessagesController.php
index 1fd24527..94569f47 100644
--- a/src/Controllers/MessagesController.php
+++ b/src/Controllers/MessagesController.php
@@ -68,7 +68,7 @@ class MessagesController extends BaseController
$users = $this->user->orderBy('name')->get()
->except($currentUser->id)
->mapWithKeys(function ($u) {
- return [ $u->id => $u->name ];
+ return [$u->id => $u->name];
});
$users->prepend($currentUser->name, $currentUser->id);
@@ -76,7 +76,7 @@ class MessagesController extends BaseController
'pages/messages/overview.twig',
[
'conversations' => $conversations,
- 'users' => $users
+ 'users' => $users,
]
);
}
@@ -185,7 +185,7 @@ class MessagesController extends BaseController
->groupBy('user_id')
->get(['user_id', 'amount'])
->mapWithKeys(function ($unread) {
- return [ $unread->user_id => $unread->amount ];
+ return [$unread->user_id => $unread->amount];
});
}
diff --git a/src/Controllers/Metrics/Controller.php b/src/Controllers/Metrics/Controller.php
index cccccff5..78a86fb5 100644
--- a/src/Controllers/Metrics/Controller.php
+++ b/src/Controllers/Metrics/Controller.php
@@ -126,7 +126,7 @@ class Controller extends BaseController
'tshirts_issued' => ['type' => 'counter', 'help' => 'Issued T-Shirts', $this->stats->tshirts()],
'tshirt_sizes' => [
'type' => 'gauge',
- 'help' => 'The sizes users have configured'
+ 'help' => 'The sizes users have configured',
] + $userTshirtSizes,
'locales' => ['type' => 'gauge', 'help' => 'The locales users have configured'] + $userLocales,
'themes' => ['type' => 'gauge', 'help' => 'The themes users have configured'] + $userThemes,
diff --git a/src/Controllers/OAuthController.php b/src/Controllers/OAuthController.php
index 565982c7..a0fc00e9 100644
--- a/src/Controllers/OAuthController.php
+++ b/src/Controllers/OAuthController.php
@@ -56,7 +56,7 @@ class OAuthController extends BaseController
[
// Leauge separates scopes by comma, which is wrong, so we do it
// here properly by spaces. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3
- 'scope' => join(' ', $config['scope'] ?? [])
+ 'scope' => join(' ', $config['scope'] ?? []),
]
);
$this->session->set('oauth2_state', $provider->getState());
@@ -80,7 +80,7 @@ class OAuthController extends BaseController
$accessToken = $provider->getAccessToken(
'authorization_code',
[
- 'code' => $request->get('code')
+ 'code' => $request->get('code'),
]
);
} catch (IdentityProviderException $e) {
@@ -258,7 +258,7 @@ class OAuthController extends BaseController
'provider' => $providerName,
'user' => $this->getId($providerName, $resourceOwner),
'name' => $user->name,
- 'id' => $user->id
+ 'id' => $user->id,
]
);
}
diff --git a/src/Controllers/SettingsController.php b/src/Controllers/SettingsController.php
index 5b42e903..87136bc9 100644
--- a/src/Controllers/SettingsController.php
+++ b/src/Controllers/SettingsController.php
@@ -114,7 +114,7 @@ class SettingsController extends BaseController
'pages/settings/password',
[
'settings_menu' => $this->settingsMenu(),
- 'min_length' => config('min_password_length')
+ 'min_length' => config('min_password_length'),
] + $this->getNotifications()
);
}
@@ -157,7 +157,7 @@ class SettingsController extends BaseController
[
'settings_menu' => $this->settingsMenu(),
'themes' => $themes,
- 'current_theme' => $currentTheme
+ 'current_theme' => $currentTheme,
] + $this->getNotifications()
);
}
@@ -191,7 +191,7 @@ class SettingsController extends BaseController
[
'settings_menu' => $this->settingsMenu(),
'languages' => $languages,
- 'current_language' => $currentLanguage
+ 'current_language' => $currentLanguage,
] + $this->getNotifications()
);
}
@@ -238,7 +238,7 @@ class SettingsController extends BaseController
url('/settings/profile') => 'settings.profile',
url('/settings/password') => 'settings.password',
url('/settings/language') => 'settings.language',
- url('/settings/theme') => 'settings.theme'
+ url('/settings/theme') => 'settings.theme',
];
if (!empty(config('oauth'))) {
diff --git a/src/Helpers/BarChart.php b/src/Helpers/BarChart.php
index e6378145..526d529a 100644
--- a/src/Helpers/BarChart.php
+++ b/src/Helpers/BarChart.php
@@ -160,7 +160,7 @@ class BarChart
[
'count' => '#090',
- 'sum' => '#888'
+ 'sum' => '#888',
],
$demoData,
];
diff --git a/src/Models/Question.php b/src/Models/Question.php
index 331e6409..cab51ae8 100644
--- a/src/Models/Question.php
+++ b/src/Models/Question.php
@@ -38,7 +38,7 @@ class Question extends BaseModel
/** @var array */
protected $dates = [ // phpcs:ignore
- 'answered_at'
+ 'answered_at',
];
/** @var array */
diff --git a/tests/Unit/Controllers/Admin/NewsControllerTest.php b/tests/Unit/Controllers/Admin/NewsControllerTest.php
index 54d4061a..d991d006 100644
--- a/tests/Unit/Controllers/Admin/NewsControllerTest.php
+++ b/tests/Unit/Controllers/Admin/NewsControllerTest.php
@@ -26,7 +26,7 @@ class NewsControllerTest extends ControllerTest
'title' => 'Foo',
'text' => '**foo**',
'user_id' => 1,
- ]
+ ],
];
/**
diff --git a/tests/Unit/Controllers/Admin/UserWorkLogControllerTest.php b/tests/Unit/Controllers/Admin/UserWorkLogControllerTest.php
index fd8368fa..e4598ee3 100644
--- a/tests/Unit/Controllers/Admin/UserWorkLogControllerTest.php
+++ b/tests/Unit/Controllers/Admin/UserWorkLogControllerTest.php
@@ -110,7 +110,7 @@ class UserWorkLogControllerTest extends ControllerTest
'user_id' => $this->user->id,
'worked_at' => new Carbon('2022-01-01'),
'hours' => 3.14,
- 'comment' => 'a comment'
+ 'comment' => 'a comment',
])->create();
$request = $this->request
diff --git a/tests/Unit/Controllers/Metrics/ControllerTest.php b/tests/Unit/Controllers/Metrics/ControllerTest.php
index f5b8e497..66bc2a9e 100644
--- a/tests/Unit/Controllers/Metrics/ControllerTest.php
+++ b/tests/Unit/Controllers/Metrics/ControllerTest.php
@@ -71,7 +71,7 @@ class ControllerTest extends TestCase
$this->assertArraySubset(['tshirt_sizes' => [
'type' => 'gauge',
['labels' => ['size' => 'L'], 2],
- ['labels' => ['size' => 'XL'], 0]
+ ['labels' => ['size' => 'XL'], 0],
]], $data);
return 'metrics return';
diff --git a/tests/Unit/Controllers/Metrics/MetricsEngineTest.php b/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
index 42560889..52160fa7 100644
--- a/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
+++ b/tests/Unit/Controllers/Metrics/MetricsEngineTest.php
@@ -77,7 +77,7 @@ engelsystem_test_minimum_histogram_count 4
EOD,
$engine->get('/metrics', [
'test_minimum_histogram' => [
- 'type' => 'histogram', [3 => 4, 'sum' => 1.337]
+ 'type' => 'histogram', [3 => 4, 'sum' => 1.337],
],
])
);
@@ -96,7 +96,7 @@ EOD,
$engine->get('/metrics', [
'test_short_histogram' => [
'type' => 'histogram',
- 'value' => [120 => 19, '+Inf' => 300, 60 => 10, 0 => 0, 'sum' => 123.456]
+ 'value' => [120 => 19, '+Inf' => 300, 60 => 10, 0 => 0, 'sum' => 123.456],
],
])
);
@@ -134,7 +134,7 @@ engelsystem_test_minimum_histogram_count NaN
EOD,
$engine->get('/metrics', [
'test_minimum_histogram' => [
- 'type' => 'histogram', []
+ 'type' => 'histogram', [],
],
])
);
diff --git a/tests/Unit/Controllers/Metrics/StatsTest.php b/tests/Unit/Controllers/Metrics/StatsTest.php
index fb90fc4b..63b916ff 100644
--- a/tests/Unit/Controllers/Metrics/StatsTest.php
+++ b/tests/Unit/Controllers/Metrics/StatsTest.php
@@ -155,7 +155,7 @@ class StatsTest extends TestCase
'creator_id' => 1,
'hours' => 2.4,
'comment' => '',
- 'worked_at' => new Carbon()
+ 'worked_at' => new Carbon(),
];
(new Worklog($worklogData))->save();
(new Worklog(['hours' => 1.2, 'user_id' => 3] + $worklogData))->save();
@@ -183,7 +183,7 @@ class StatsTest extends TestCase
2 * 60 * 60,
3 * 60 * 60,
4 * 60 * 60,
- '+Inf'
+ '+Inf',
]);
$this->assertEquals([
diff --git a/tests/Unit/Controllers/OAuthControllerTest.php b/tests/Unit/Controllers/OAuthControllerTest.php
index 52e24532..43976e98 100644
--- a/tests/Unit/Controllers/OAuthControllerTest.php
+++ b/tests/Unit/Controllers/OAuthControllerTest.php
@@ -387,7 +387,7 @@ class OAuthControllerTest extends TestCase
['unsupported_response_type'],
['invalid_scope'],
['server_error'],
- ['temporarily_unavailable']
+ ['temporarily_unavailable'],
];
}
@@ -612,7 +612,7 @@ class OAuthControllerTest extends TestCase
$this->oauth,
$this->redirect,
$this->session,
- $this->url
+ $this->url,
])
->onlyMethods($mockMethods)
->getMock();
diff --git a/tests/Unit/Controllers/PasswordResetControllerTest.php b/tests/Unit/Controllers/PasswordResetControllerTest.php
index 471621a7..d0d5fb09 100644
--- a/tests/Unit/Controllers/PasswordResetControllerTest.php
+++ b/tests/Unit/Controllers/PasswordResetControllerTest.php
@@ -208,7 +208,7 @@ class PasswordResetControllerTest extends TestCase
'session' => $session,
'mailer' => $mailer,
'log' => $log,
- 'renderer' => $renderer
+ 'renderer' => $renderer,
];
}
diff --git a/tests/Unit/Controllers/SettingsControllerTest.php b/tests/Unit/Controllers/SettingsControllerTest.php
index 1bcce781..4f161f11 100644
--- a/tests/Unit/Controllers/SettingsControllerTest.php
+++ b/tests/Unit/Controllers/SettingsControllerTest.php
@@ -251,7 +251,7 @@ class SettingsControllerTest extends ControllerTest
$body = [
'password' => 'password',
'new_password' => 'newpassword',
- 'new_password2' => 'newpassword'
+ 'new_password2' => 'newpassword',
];
$this->request = $this->request->withParsedBody($body);
@@ -286,7 +286,7 @@ class SettingsControllerTest extends ControllerTest
$body = [
'new_password' => 'anotherpassword',
- 'new_password2' => 'anotherpassword'
+ 'new_password2' => 'anotherpassword',
];
$this->request = $this->request->withParsedBody($body);
@@ -311,7 +311,7 @@ class SettingsControllerTest extends ControllerTest
$body = [
'password' => 'wrongpassword',
'new_password' => 'newpassword',
- 'new_password2' => 'newpassword'
+ 'new_password2' => 'newpassword',
];
$this->request = $this->request->withParsedBody($body);
@@ -342,7 +342,7 @@ class SettingsControllerTest extends ControllerTest
$body = [
'password' => 'password',
'new_password' => 'newpassword',
- 'new_password2' => 'wrongpassword'
+ 'new_password2' => 'wrongpassword',
];
$this->request = $this->request->withParsedBody($body);
@@ -371,7 +371,7 @@ class SettingsControllerTest extends ControllerTest
[null, 'newpassword', 'newpassword'],
['password', null, 'newpassword'],
['password', 'newpassword', null],
- ['password', 'short', 'short']
+ ['password', 'short', 'short'],
];
}
@@ -389,7 +389,7 @@ class SettingsControllerTest extends ControllerTest
$body = [
'password' => $password,
'new_password' => $newPassword,
- 'new_password2' => $newPassword2
+ 'new_password2' => $newPassword2,
];
$this->request = $this->request->withParsedBody($body);
@@ -594,7 +594,7 @@ class SettingsControllerTest extends ControllerTest
'http://localhost/settings/password' => 'settings.password',
'http://localhost/settings/language' => 'settings.language',
'http://localhost/settings/theme' => 'settings.theme',
- 'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => false]
+ 'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => false],
], $this->controller->settingsMenu());
config(['oauth' => $providersHidden]);
@@ -603,7 +603,7 @@ class SettingsControllerTest extends ControllerTest
'http://localhost/settings/password' => 'settings.password',
'http://localhost/settings/language' => 'settings.language',
'http://localhost/settings/theme' => 'settings.theme',
- 'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => true]
+ 'http://localhost/settings/oauth' => ['title' => 'settings.oauth', 'hidden' => true],
], $this->controller->settingsMenu());
}
@@ -618,7 +618,7 @@ class SettingsControllerTest extends ControllerTest
'http://localhost/settings/profile' => 'settings.profile',
'http://localhost/settings/password' => 'settings.password',
'http://localhost/settings/language' => 'settings.language',
- 'http://localhost/settings/theme' => 'settings.theme'
+ 'http://localhost/settings/theme' => 'settings.theme',
], $this->controller->settingsMenu());
}
@@ -631,18 +631,18 @@ class SettingsControllerTest extends ControllerTest
$themes = [
0 => ['name' => 'Engelsystem light'],
- 1 => ['name' => 'Engelsystem dark']
+ 1 => ['name' => 'Engelsystem dark'],
];
$languages = [
'en_US' => 'English',
- 'de_DE' => 'Deutsch'
+ 'de_DE' => 'Deutsch',
];
$tshirt_sizes = ['S' => 'Small'];
$this->config = new Config([
'min_password_length' => 6,
'themes' => $themes,
'locales' => $languages,
- 'tshirt_sizes' => $tshirt_sizes
+ 'tshirt_sizes' => $tshirt_sizes,
]);
$this->app->instance('config', $this->config);
$this->app->instance(Config::class, $this->config);
diff --git a/tests/Unit/Database/Migration/MigrateTest.php b/tests/Unit/Database/Migration/MigrateTest.php
index 8dfe8959..957c9871 100644
--- a/tests/Unit/Database/Migration/MigrateTest.php
+++ b/tests/Unit/Database/Migration/MigrateTest.php
@@ -152,7 +152,7 @@ class MigrateTest extends TestCase
$this->setExpects($migration, 'lockTable');
$this->setExpects($migration, 'unlockTable');
$this->setExpects($migration, 'getMigrations', null, collect([
- ['migration' => '1234_01_23_123456_init_foo', 'path' => '/foo']
+ ['migration' => '1234_01_23_123456_init_foo', 'path' => '/foo'],
]));
$this->setExpects($migration, 'getMigrated', null, collect([]));
$migration->expects($this->once())
diff --git a/tests/Unit/Events/EventsServiceProviderTest.php b/tests/Unit/Events/EventsServiceProviderTest.php
index 54b04572..7345a38e 100644
--- a/tests/Unit/Events/EventsServiceProviderTest.php
+++ b/tests/Unit/Events/EventsServiceProviderTest.php
@@ -30,8 +30,8 @@ class EventsServiceProviderTest extends ServiceProviderTest
$config = new Config([
'event-handlers' => [
'test.event' => 'someFunction',
- 'another.event' => ['Foo\Bar@baz', [$this, 'testRegister']]
- ]
+ 'another.event' => ['Foo\Bar@baz', [$this, 'testRegister']],
+ ],
]);
$this->app->instance('config', $config);
diff --git a/tests/Unit/Events/Listener/OAuth2Test.php b/tests/Unit/Events/Listener/OAuth2Test.php
index 9614e362..6a66a2cc 100644
--- a/tests/Unit/Events/Listener/OAuth2Test.php
+++ b/tests/Unit/Events/Listener/OAuth2Test.php
@@ -171,7 +171,7 @@ class OAuth2Test extends TestCase
'groups' => 'groups_key',
'teams' => [
'/test' => 21,
- '/lorem' => ['id' => 42, 'supporter' => true]
+ '/lorem' => ['id' => 42, 'supporter' => true],
],
],
]]);
diff --git a/tests/Unit/FakerProvider.php b/tests/Unit/FakerProvider.php
index 2fc4aaef..4e48fe7a 100644
--- a/tests/Unit/FakerProvider.php
+++ b/tests/Unit/FakerProvider.php
@@ -22,7 +22,7 @@ class FakerProvider extends Base
've',
'xe',
'ze',
- 'zie'
+ 'zie',
];
/** @var string[] */
diff --git a/tests/Unit/Helpers/BarChartTest.php b/tests/Unit/Helpers/BarChartTest.php
index 5afa0c4d..2999942e 100644
--- a/tests/Unit/Helpers/BarChartTest.php
+++ b/tests/Unit/Helpers/BarChartTest.php
@@ -77,7 +77,7 @@ class BarChartTest extends TestCase
'rowLabels' => self::ROW_LABELS,
'barChartClass' => '',
'yLabels' => $yLabels,
- ]
+ ],
];
yield 'non-empty data' => [
self::DATA,
diff --git a/tests/Unit/Helpers/DumpServerServiceProviderTest.php b/tests/Unit/Helpers/DumpServerServiceProviderTest.php
index c0e7961e..fe55d85e 100644
--- a/tests/Unit/Helpers/DumpServerServiceProviderTest.php
+++ b/tests/Unit/Helpers/DumpServerServiceProviderTest.php
@@ -25,7 +25,7 @@ class DumpServerServiceProviderTest extends ServiceProviderTest
$varDumpServerConfig = [
'host' => 'localhost',
'port' => 80,
- 'enable' => true
+ 'enable' => true,
];
$config = new Config();
@@ -69,7 +69,7 @@ class DumpServerServiceProviderTest extends ServiceProviderTest
$varDumpServerConfig = [
'host' => 'localhost',
'port' => 80,
- 'enable' => $enable
+ 'enable' => $enable,
];
$config = new Config();
diff --git a/tests/Unit/Helpers/UuidTest.php b/tests/Unit/Helpers/UuidTest.php
index baf83f71..821a014c 100644
--- a/tests/Unit/Helpers/UuidTest.php
+++ b/tests/Unit/Helpers/UuidTest.php
@@ -29,7 +29,7 @@ class UuidTest extends TestCase
['42', 'a1d0c6e8-3f02-4327-9846-1063f4ac58a6'],
[1.23, '579c4c7f-58e4-45e8-8cfc-73e08903a08c'],
['1.23', '579c4c7f-58e4-45e8-8cfc-73e08903a08c'],
- ['test', '098f6bcd-4621-4373-8ade-4e832627b4f6']
+ ['test', '098f6bcd-4621-4373-8ade-4e832627b4f6'],
];
}
diff --git a/tests/Unit/Http/SessionServiceProviderTest.php b/tests/Unit/Http/SessionServiceProviderTest.php
index f989ab25..6cd6b8cd 100644
--- a/tests/Unit/Http/SessionServiceProviderTest.php
+++ b/tests/Unit/Http/SessionServiceProviderTest.php
@@ -60,7 +60,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
[
// 2 days
'options' => ['cookie_httponly' => true, 'name' => 'session', 'cookie_lifetime' => 172800],
- 'handler' => null
+ 'handler' => null,
],
],
[Session::class],
@@ -70,7 +70,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
[
// 5 days
'options' => ['cookie_httponly' => true, 'name' => 'foobar', 'cookie_lifetime' => 432000],
- 'handler' => $databaseHandler
+ 'handler' => $databaseHandler,
],
],
[Session::class]
diff --git a/tests/Unit/Logger/LoggerTest.php b/tests/Unit/Logger/LoggerTest.php
index c0ba3e5c..5e8e8361 100644
--- a/tests/Unit/Logger/LoggerTest.php
+++ b/tests/Unit/Logger/LoggerTest.php
@@ -75,7 +75,7 @@ class LoggerTest extends ServiceProviderTest
{
return 'Bar';
}
- }
+ },
]);
}
}
diff --git a/tests/Unit/Models/NewsTest.php b/tests/Unit/Models/NewsTest.php
index 0b735587..e64f0d7b 100644
--- a/tests/Unit/Models/NewsTest.php
+++ b/tests/Unit/Models/NewsTest.php
@@ -25,7 +25,7 @@ class NewsTest extends ModelTest
$this->newsData = [
'title' => 'test title',
'text' => 'test text',
- 'user_id' => $this->user->id
+ 'user_id' => $this->user->id,
];
}
diff --git a/tests/Unit/Models/User/UserTest.php b/tests/Unit/Models/User/UserTest.php
index 24e957f9..b655f477 100644
--- a/tests/Unit/Models/User/UserTest.php
+++ b/tests/Unit/Models/User/UserTest.php
@@ -128,9 +128,9 @@ class UserTest extends ModelTest
],
[
'name' => 'Ipsum',
- ]
- ]
- ]
+ ],
+ ],
+ ],
];
}