@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Selami\View\Twig; |
5 | 5 | |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | $dictionary = $this->config['dictionary']?? []; |
33 | 33 | $filter = new \Twig_SimpleFunction( |
34 | 34 | 'translate', |
35 | - function ( |
|
35 | + function( |
|
36 | 36 | $string, ...$findAndReplace |
37 | 37 | ) use ($dictionary) { |
38 | 38 | if (array_key_exists($string, $dictionary)) { |
39 | 39 | $string = $dictionary[$string]; |
40 | 40 | } |
41 | - if (! empty($findAndReplace)) { |
|
41 | + if (!empty($findAndReplace)) { |
|
42 | 42 | foreach ($findAndReplace[0] as $find => $replace) { |
43 | - $string = str_replace('{{'.$find.'}}', $replace, $string); |
|
43 | + $string = str_replace('{{' . $find . '}}', $replace, $string); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | return $string; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $filter = new Twig_SimpleFunction( |
56 | 56 | 'getUrl', |
57 | - function ( |
|
57 | + function( |
|
58 | 58 | $alias, |
59 | 59 | $params = [] |
60 | 60 | ) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $filter = new \Twig_SimpleFunction( |
77 | 77 | 'Widget_*_*', |
78 | - function ($widgetNameStr, $widgetActionStr, $args = []) { |
|
78 | + function($widgetNameStr, $widgetActionStr, $args = []) { |
|
79 | 79 | $function = new Functions\Widget($this->twig, $this->config, $widgetNameStr, $widgetActionStr, $args); |
80 | 80 | return $function->run(); |
81 | 81 | }, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | { |
89 | 89 | $filter = new \Twig_SimpleFunction( |
90 | 90 | 'queryParams', |
91 | - function ($queryParams, $prefix = '?') { |
|
91 | + function($queryParams, $prefix = '?') { |
|
92 | 92 | return $prefix . http_build_query($queryParams); |
93 | 93 | }, |
94 | 94 | array('is_safe' => array('html')) |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $filter = new \Twig_SimpleFunction( |
102 | 102 | 'siteUrl', |
103 | - function ($path = '') { |
|
103 | + function($path = '') { |
|
104 | 104 | return $this->config['runtime']['base_url'] . $path; |
105 | 105 | }, |
106 | 106 | array('is_safe' => array('html')) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | $filter = new \Twig_SimpleFunction( |
114 | 114 | 'varDump', |
115 | - function ($args) { |
|
115 | + function($args) { |
|
116 | 116 | /** |
117 | 117 | * @noinspection ForgottenDebugOutputInspection |
118 | 118 | */ |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | $filter = new \Twig_SimpleFunction( |
132 | 132 | 'Pagination', |
133 | - function ( |
|
133 | + function( |
|
134 | 134 | int $total, |
135 | 135 | int $current, |
136 | 136 | string $linkTemplate, |