mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 09:05:01 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user