From 216185b65c4d298cb0a06371f905c7229faf6bae Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 5 Feb 2023 16:34:16 +0100 Subject: [PATCH] Don't use double-quoted strings if not needed --- .phpcs.xml | 1 + includes/pages/admin_user.php | 4 ++-- includes/sys_page.php | 2 +- includes/sys_template.php | 2 +- includes/view/ShiftCalendarShiftRenderer.php | 14 +++++++------- src/Controllers/DesignController.php | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 58486753..0c36fa5b 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -40,6 +40,7 @@ + /includes diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index d562677d..7f2f6874 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -65,7 +65,7 @@ function admin_user() $html .= ' ' . __('DECT') . '' . '' . "\n"; } if ($user_source->settings->email_human) { - $html .= " " . __('settings.profile.email') . "" . '' . "\n"; + $html .= ' ' . __('settings.profile.email') . '' . '' . "\n"; } if (config('enable_tshirt_size') && !config('other_goodie')) { $html .= ' ' . __('user.shirt_size') . '' @@ -178,7 +178,7 @@ function admin_user() button(user_delete_link($user_source->id), icon('trash') . __('delete'), 'btn-danger') ]); - $html .= "
"; + $html .= '
'; } else { switch ($request->input('action')) { case 'save_groups': diff --git a/includes/sys_page.php b/includes/sys_page.php index 9909b697..a5eb7142 100644 --- a/includes/sys_page.php +++ b/includes/sys_page.php @@ -249,7 +249,7 @@ function strip_request_item_nl($name, $default_value = null) function strip_item($item) { // Only allow letters, symbols, punctuation, separators and numbers without html tags - return preg_replace("/([^\p{L}\p{S}\p{P}\p{Z}\p{N}+]+)/ui", '', strip_tags($item)); + return preg_replace('/([^\p{L}\p{S}\p{P}\p{Z}\p{N}+]+)/ui', '', strip_tags($item)); } /** diff --git a/includes/sys_template.php b/includes/sys_template.php index 49915baf..db789d87 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -340,7 +340,7 @@ function render_table($columns, $rows, $data = true) foreach ($rows as $row) { $html .= ''; foreach ($columns as $key => $column) { - $value = " "; + $value = ' '; if (isset($row[$key])) { $value = $row[$key]; } diff --git a/includes/view/ShiftCalendarShiftRenderer.php b/includes/view/ShiftCalendarShiftRenderer.php index e1f104bb..72f56f00 100644 --- a/includes/view/ShiftCalendarShiftRenderer.php +++ b/includes/view/ShiftCalendarShiftRenderer.php @@ -197,11 +197,11 @@ class ShiftCalendarShiftRenderer ? $inner_text . icon('mortarboard-fill') // Add link to join the angeltype first : $inner_text . '
' - . button( - page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype->id]), - sprintf(__('Become %s'), $angeltype->name), - 'btn-sm' - ), + . button( + page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype->id]), + sprintf(__('Become %s'), $angeltype->name), + 'btn-sm' + ), // Shift collides or user is already signed up: No signup allowed ShiftSignupStatus::COLLIDES, ShiftSignupStatus::SIGNED_UP => $inner_text, // Shift is full @@ -251,12 +251,12 @@ class ShiftCalendarShiftRenderer button( page_link_to('user_shifts', ['edit_shift' => $shift->id]), icon('pencil'), - "btn-$class btn-sm border-light text-white" + 'btn-' . $class . ' btn-sm border-light text-white' ), button( page_link_to('user_shifts', ['delete_shift' => $shift->id]), icon('trash'), - "btn-$class btn-sm border-light text-white" + 'btn-' . $class . ' btn-sm border-light text-white' ) ]) . ''; } diff --git a/src/Controllers/DesignController.php b/src/Controllers/DesignController.php index db71dcc6..a9935f73 100644 --- a/src/Controllers/DesignController.php +++ b/src/Controllers/DesignController.php @@ -53,7 +53,7 @@ class DesignController extends BaseController $date = CarbonImmutable::now(); for ($i = 1; $i <= 600; $i++) { - $formattedDate = $date->format("Y-m-d"); + $formattedDate = $date->format('Y-m-d'); $dateSelectOptions[$formattedDate] = $formattedDate; $date = $date->addDay(); }