@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * Build translate array. |
| 65 | 65 | * |
| 66 | 66 | * @param $translateArray |
| 67 | - * @return array |
|
| 67 | + * @return string |
|
| 68 | 68 | */ |
| 69 | 69 | private function buildTranslateArray(array $translateArray) : array |
| 70 | 70 | { |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | 'varDump', |
| 173 | 173 | function ($args) { |
| 174 | 174 | /** |
| 175 | - * @noinspection ForgottenDebugOutputInspection |
|
| 176 | - */ |
|
| 175 | + * @noinspection ForgottenDebugOutputInspection |
|
| 176 | + */ |
|
| 177 | 177 | var_dump($args); |
| 178 | 178 | }, |
| 179 | 179 | array('is_safe' => array('html')) |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | protected function extendForPagination() : void |
| 185 | 185 | { |
| 186 | 186 | /** |
| 187 | - * @noinspection MoreThanThreeArgumentsInspection |
|
| 187 | + * @noinspection MoreThanThreeArgumentsInspection |
|
| 188 | 188 | */ |
| 189 | 189 | $filter = new \Twig_SimpleFunction( |
| 190 | 190 | 'Pagination', |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $filter = new \Twig_SimpleFunction( |
| 46 | 46 | '_t', |
| 47 | - function ( |
|
| 47 | + function( |
|
| 48 | 48 | $string, |
| 49 | 49 | array $findAndReplace = null |
| 50 | 50 | ) { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $tmpArray = []; |
| 72 | 72 | foreach ($translateArray as $key => $value) { |
| 73 | - $tmpArray['@'.$key] = $value; |
|
| 73 | + $tmpArray['@' . $key] = $value; |
|
| 74 | 74 | } |
| 75 | 75 | return $tmpArray; |
| 76 | 76 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $filter = new \Twig_SimpleFunction( |
| 81 | 81 | 'getUrl', |
| 82 | - function ( |
|
| 82 | + function( |
|
| 83 | 83 | $alias, |
| 84 | 84 | $params = [] |
| 85 | 85 | ) { |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | $relative_path = $data; |
| 89 | 89 | foreach ($params as $param => $value) { |
| 90 | 90 | if (strpos($param, ':') === strlen($param)-1) { |
| 91 | - $relative_path = preg_replace('/{'.$param.'(.*?)}/msi', $value, $relative_path); |
|
| 91 | + $relative_path = preg_replace('/{' . $param . '(.*?)}/msi', $value, $relative_path); |
|
| 92 | 92 | } else { |
| 93 | - $relative_path = str_replace('{'.$param.'}', $value, $relative_path); |
|
| 93 | + $relative_path = str_replace('{' . $param . '}', $value, $relative_path); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | return $this->config['base_url'] . '/' . $relative_path; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | $filter = new \Twig_SimpleFunction( |
| 108 | 108 | 'Widget_*_*', |
| 109 | - function ($widgetNameStr, $widgetActionStr, $args = []) { |
|
| 109 | + function($widgetNameStr, $widgetActionStr, $args = []) { |
|
| 110 | 110 | $widgetAction = $this->toCamelCase->transform($widgetActionStr); |
| 111 | 111 | $widgetName = $this->toCamelCase->transform($widgetNameStr); |
| 112 | 112 | $widget = '\\' . $this->config['app_namespace'] . '\\Widget\\' . $widgetName; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | ); |
| 133 | 133 | throw new InvalidArgumentException($message); |
| 134 | 134 | } |
| 135 | - $templateFile = '_widgets/' |
|
| 135 | + $templateFile = '_widgets/' |
|
| 136 | 136 | . $this->toSnakeCase->transform($widgetNameStr) . '/' . $templateFileBasename; |
| 137 | 137 | $widgetData = $widgetInstance->{$widgetAction}(); |
| 138 | 138 | return $this->twig->render($templateFile, $widgetData); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | $filter = new \Twig_SimpleFunction( |
| 148 | 148 | 'queryParams', |
| 149 | - function ($queryParams, $prefix = '?') { |
|
| 149 | + function($queryParams, $prefix = '?') { |
|
| 150 | 150 | return $prefix . http_build_query($queryParams); |
| 151 | 151 | }, |
| 152 | 152 | array('is_safe' => array('html')) |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $filter = new \Twig_SimpleFunction( |
| 160 | 160 | 'siteUrl', |
| 161 | - function ($path = '') { |
|
| 161 | + function($path = '') { |
|
| 162 | 162 | return $this->config['base_url'] . $path; |
| 163 | 163 | }, |
| 164 | 164 | array('is_safe' => array('html')) |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $filter = new \Twig_SimpleFunction( |
| 172 | 172 | 'varDump', |
| 173 | - function ($args) { |
|
| 173 | + function($args) { |
|
| 174 | 174 | /** |
| 175 | 175 | * @noinspection ForgottenDebugOutputInspection |
| 176 | 176 | */ |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | $filter = new \Twig_SimpleFunction( |
| 190 | 190 | 'Pagination', |
| 191 | - function ( |
|
| 191 | + function( |
|
| 192 | 192 | int $total, |
| 193 | 193 | int $current, |
| 194 | 194 | string $linkTemplate, |
@@ -197,9 +197,9 @@ discard block |
||
| 197 | 197 | string $linkItemTemplate = '<a href="(href)" class="(link_class)">(text)</a>', |
| 198 | 198 | string $ellipsesTemplate = '<li><a>...</a></li>' |
| 199 | 199 | ) { |
| 200 | - $items = ''; |
|
| 200 | + $items = ''; |
|
| 201 | 201 | $pageGroupLimit = 3; |
| 202 | - $useEllipses = ($total >10) ? 1 : 0; |
|
| 202 | + $useEllipses = ($total > 10) ? 1 : 0; |
|
| 203 | 203 | $renderedEllipses = 0; |
| 204 | 204 | $values = [ |
| 205 | 205 | '(item_class)' => '', |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | '(link_class)' => '', |
| 208 | 208 | '(text)' => '' |
| 209 | 209 | ]; |
| 210 | - for ($i=1; $i <= $total; $i++) { |
|
| 210 | + for ($i = 1; $i <= $total; $i++) { |
|
| 211 | 211 | $values['(link_class)'] = ''; |
| 212 | 212 | $values['(item_class)'] = ''; |
| 213 | 213 | if ($i === $current) { |