Completed
Push — master ( 485983...d1bf52 )
by Mehmet
05:26
created
src/Twig/TwigExtensions.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $filter = new \Twig_SimpleFunction(
41 41
             'getUrl',
42
-            function (
42
+            function(
43 43
                 $alias,
44 44
                 $params = []
45 45
             ) {
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
                     $relative_path = $data;
49 49
                     foreach ($params as $param => $value) {
50 50
                         if (strpos($param, ':') === strlen($param)-1) {
51
-                            $relative_path = preg_replace('/{'.$param.'(.*?)}/msi', $value, $relative_path);
51
+                            $relative_path = preg_replace('/{' . $param . '(.*?)}/msi', $value, $relative_path);
52 52
                         } else {
53
-                            $relative_path = str_replace('{'.$param.'}', $value, $relative_path);
53
+                            $relative_path = str_replace('{' . $param . '}', $value, $relative_path);
54 54
                         }
55 55
                     }
56 56
                     return $this->config['base_url'] . '/' . $relative_path;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $filter = new \Twig_SimpleFunction(
68 68
             'Widget_*_*',
69
-            function ($widgetNameStr, $widgetActionStr, $args = []) {
69
+            function($widgetNameStr, $widgetActionStr, $args = []) {
70 70
                 $widgetAction = CaseConverter::toPascalCase($widgetActionStr);
71
-                $widgetName =  CaseConverter::toPascalCase($widgetNameStr);
71
+                $widgetName = CaseConverter::toPascalCase($widgetNameStr);
72 72
                 $widget = '\\' . $this->config['app_namespace'] . '\\Widget\\' . $widgetName;
73 73
                 if (!class_exists($widget)) {
74 74
                     $message = 'Widget ' . $widgetName . '_' . $widgetAction . ' has not class name as ' . $widget;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                     );
93 93
                     throw new InvalidArgumentException($message);
94 94
                 }
95
-                $templateFile =  '_widgets/'
95
+                $templateFile = '_widgets/'
96 96
                     . CaseConverter::toSnakeCase($widgetNameStr) . '/' . $templateFileBasename;
97 97
                 $widgetData = $widgetInstance->{$widgetAction}();
98 98
                 return $this->twig->render($templateFile, $widgetData);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     {
107 107
         $filter = new \Twig_SimpleFunction(
108 108
             'queryParams',
109
-            function ($queryParams, $prefix = '?') {
109
+            function($queryParams, $prefix = '?') {
110 110
                 return $prefix . http_build_query($queryParams);
111 111
             },
112 112
             array('is_safe' => array('html'))
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $filter = new \Twig_SimpleFunction(
120 120
             'siteUrl',
121
-            function ($path = '') {
121
+            function($path = '') {
122 122
                 return $this->config['base_url'] . $path;
123 123
             },
124 124
             array('is_safe' => array('html'))
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $filter = new \Twig_SimpleFunction(
132 132
             'varDump',
133
-            function ($args) {
133
+            function($args) {
134 134
                 /**
135 135
             * @noinspection ForgottenDebugOutputInspection 
136 136
             */
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 */
149 149
         $filter = new \Twig_SimpleFunction(
150 150
             'Pagination',
151
-            function (
151
+            function(
152 152
                 int $total,
153 153
                 int $current,
154 154
                 string $linkTemplate,
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                 string $linkItemTemplate = '<a href="(href)" class="(link_class)">(text)</a>',
158 158
                 string $ellipsesTemplate = '<li><a>...</a></li>'
159 159
             ) {
160
-                $items =  '';
160
+                $items = '';
161 161
                 $pageGroupLimit = 3;
162
-                $useEllipses = ($total >10) ? 1 : 0;
162
+                $useEllipses = ($total > 10) ? 1 : 0;
163 163
                 $renderedEllipses = 0;
164 164
                 $values = [
165 165
                     '(item_class)'  => '',
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                     '(link_class)'  => '',
168 168
                     '(text)'  => ''
169 169
                 ];
170
-                for ($i=1; $i <= $total; $i++) {
170
+                for ($i = 1; $i <= $total; $i++) {
171 171
                     $values['(link_class)'] = '';
172 172
                     $values['(item_class)'] = '';
173 173
                     if ($i === $current) {
Please login to merge, or discard this patch.