apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -16,8 +16,6 @@ use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use function array_merge;
class ChillTwigHelper extends AbstractExtension
{
public function getFilters()
@@ -46,7 +44,7 @@ class ChillTwigHelper extends AbstractExtension
* - `date_format` (default to `'medium'`)
* - `time_format` (default to `'none'`)
*
* @param string $value Default to 'No value'. Fallback to default if null
* @param string $value Default to 'No value'. Fallback to default if null
* @param string $message
* @param string $template
*
@@ -59,24 +57,24 @@ class ChillTwigHelper extends AbstractExtension
$template = 'default',
array $options = []
) {
if ($value instanceof DateTimeInterface) {
$options = array_merge([
if ($value instanceof \DateTimeInterface) {
$options = \array_merge([
'date_format' => 'medium',
'time_format' => 'none',
], $options);
$t = match ($template) {
'default', 'blockquote' => '@ChillMain/Extensions/PrintOrMessage/' . $template . '_date.html.twig',
'default', 'blockquote' => '@ChillMain/Extensions/PrintOrMessage/'.$template.'_date.html.twig',
default => $template,
};
} else {
$t = match ($template) {
'default', 'blockquote' => '@ChillMain/Extensions/PrintOrMessage/' . $template . '.html.twig',
'default', 'blockquote' => '@ChillMain/Extensions/PrintOrMessage/'.$template.'.html.twig',
default => $template,
};
}
return $twig->render($t, array_merge([
return $twig->render($t, \array_merge([
'value' => $value,
'message' => $message,
], $options));