Don't use double-quoted strings if not needed

This commit is contained in:
Igor Scheller 2023-02-05 16:34:16 +01:00 committed by Michael Weimann
parent a1a1cf6f93
commit 216185b65c
6 changed files with 13 additions and 12 deletions

View File

@ -40,6 +40,7 @@
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment" />
<rule ref="Generic.Formatting.SpaceAfterCast" />
<rule ref="Squiz.Strings.DoubleQuoteUsage" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<exclude-pattern>/includes</exclude-pattern>
<properties>

View File

@ -65,7 +65,7 @@ function admin_user()
$html .= ' <tr><td>' . __('DECT') . '</td><td>' . '<input size="40" name="eDECT" value="' . $user_source->contact->dect . '" class="form-control" maxlength="40"></td></tr>' . "\n";
}
if ($user_source->settings->email_human) {
$html .= " <tr><td>" . __('settings.profile.email') . "</td><td>" . '<input type="email" size="40" name="eemail" value="' . $user_source->email . '" class="form-control" maxlength="254"></td></tr>' . "\n";
$html .= ' <tr><td>' . __('settings.profile.email') . '</td><td>' . '<input type="email" size="40" name="eemail" value="' . $user_source->email . '" class="form-control" maxlength="254"></td></tr>' . "\n";
}
if (config('enable_tshirt_size') && !config('other_goodie')) {
$html .= ' <tr><td>' . __('user.shirt_size') . '</td><td>'
@ -178,7 +178,7 @@ function admin_user()
button(user_delete_link($user_source->id), icon('trash') . __('delete'), 'btn-danger')
]);
$html .= "<hr />";
$html .= '<hr>';
} else {
switch ($request->input('action')) {
case 'save_groups':

View File

@ -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));
}
/**

View File

@ -340,7 +340,7 @@ function render_table($columns, $rows, $data = true)
foreach ($rows as $row) {
$html .= '<tr>';
foreach ($columns as $key => $column) {
$value = "&nbsp;";
$value = '&nbsp;';
if (isset($row[$key])) {
$value = $row[$key];
}

View File

@ -197,11 +197,11 @@ class ShiftCalendarShiftRenderer
? $inner_text . icon('mortarboard-fill')
// Add link to join the angeltype first
: $inner_text . '<br />'
. 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'
)
]) . '</div>';
}

View File

@ -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();
}