@@ -152,7 +152,7 @@ |
||
| 152 | 152 | { |
| 153 | 153 | $themes = array_filter( |
| 154 | 154 | $loadedThemes, |
| 155 | - function ($element) use (&$themeName) { |
|
| 155 | + function($element) use (&$themeName) { |
|
| 156 | 156 | return $element->getName() === $themeName; |
| 157 | 157 | } |
| 158 | 158 | ); |
@@ -196,7 +196,7 @@ |
||
| 196 | 196 | */ |
| 197 | 197 | private function getArrayOfIdsFromRoutesArray(array $routes): array |
| 198 | 198 | { |
| 199 | - return array_map(function ($route) { |
|
| 199 | + return array_map(function($route) { |
|
| 200 | 200 | return $route->getId(); |
| 201 | 201 | }, $routes); |
| 202 | 202 | } |
@@ -76,22 +76,22 @@ |
||
| 76 | 76 | public function getFilters() |
| 77 | 77 | { |
| 78 | 78 | return [ |
| 79 | - new \Twig_SimpleFilter('start', function ($node, $value) { |
|
| 79 | + new \Twig_SimpleFilter('start', function($node, $value) { |
|
| 80 | 80 | $node['_collection_type_filters']['start'] = $value; |
| 81 | 81 | |
| 82 | 82 | return $node; |
| 83 | 83 | }, ['needs_context' => false]), |
| 84 | - new \Twig_SimpleFilter('limit', function ($node, $value) { |
|
| 84 | + new \Twig_SimpleFilter('limit', function($node, $value) { |
|
| 85 | 85 | $node['_collection_type_filters']['limit'] = $value; |
| 86 | 86 | |
| 87 | 87 | return $node; |
| 88 | 88 | }, ['needs_context' => false]), |
| 89 | - new \Twig_SimpleFilter('order', function ($node, $value1, $value2) { |
|
| 89 | + new \Twig_SimpleFilter('order', function($node, $value1, $value2) { |
|
| 90 | 90 | $node['_collection_type_filters']['order'] = [$value1, $value2]; |
| 91 | 91 | |
| 92 | 92 | return $node; |
| 93 | 93 | }, ['needs_context' => false]), |
| 94 | - new \Twig_SimpleFilter('dateRange', function ($node, $value1, $value2) { |
|
| 94 | + new \Twig_SimpleFilter('dateRange', function($node, $value1, $value2) { |
|
| 95 | 95 | $node['_collection_type_filters']['date_range'] = [$value1, $value2]; |
| 96 | 96 | |
| 97 | 97 | return $node; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $routeNodeDefinition = $routesNodeDefinition->prototype('array'); |
| 143 | 143 | $routeNodeDefinition |
| 144 | 144 | ->validate() |
| 145 | - ->ifTrue(function ($route) { |
|
| 145 | + ->ifTrue(function($route) { |
|
| 146 | 146 | return [] === $route; |
| 147 | 147 | }) |
| 148 | 148 | ->thenInvalid('Route cannot be empty!') |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $menuNodeDefinition = $menusNodeDefinition->prototype('array'); |
| 171 | 171 | $menuNodeDefinition |
| 172 | 172 | ->validate() |
| 173 | - ->ifTrue(function ($menu) { |
|
| 173 | + ->ifTrue(function($menu) { |
|
| 174 | 174 | return [] === $menu; |
| 175 | 175 | }) |
| 176 | 176 | ->thenInvalid('Menu cannot be empty!') |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $childrenNodeDefinition = $childrensNodeDefinition->prototype('array'); |
| 189 | 189 | $childrenNodeDefinition |
| 190 | 190 | ->validate() |
| 191 | - ->ifTrue(function ($menu) { |
|
| 191 | + ->ifTrue(function($menu) { |
|
| 192 | 192 | return [] === $menu; |
| 193 | 193 | }) |
| 194 | 194 | ->thenInvalid('Menu cannot be empty!') |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $childrensChildrenNodeDefinition = $childrensChildrensNodeDefinition->prototype('array'); |
| 207 | 207 | $childrensChildrenNodeDefinition |
| 208 | 208 | ->validate() |
| 209 | - ->ifTrue(function ($menu) { |
|
| 209 | + ->ifTrue(function($menu) { |
|
| 210 | 210 | return [] === $menu; |
| 211 | 211 | }) |
| 212 | 212 | ->thenInvalid('Menu cannot be empty!') |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $containerNodeDefinition = $containersNodeDefinition->prototype('array'); |
| 232 | 232 | $containerNodeDefinition |
| 233 | 233 | ->validate() |
| 234 | - ->ifTrue(function ($widget) { |
|
| 234 | + ->ifTrue(function($widget) { |
|
| 235 | 235 | return [] === $widget; |
| 236 | 236 | }) |
| 237 | 237 | ->thenInvalid('Widget cannot be empty!') |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $containerNodeDefinition = $containersNodeDefinition->prototype('array'); |
| 255 | 255 | $containerNodeDefinition |
| 256 | 256 | ->validate() |
| 257 | - ->ifTrue(function ($widget) { |
|
| 257 | + ->ifTrue(function($widget) { |
|
| 258 | 258 | return [] === $widget; |
| 259 | 259 | }) |
| 260 | 260 | ->thenInvalid('Content List cannot be empty!') |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $widgetNodeDefinition = $widgetsNodeDefinition->prototype('array'); |
| 279 | 279 | $widgetNodeDefinition |
| 280 | 280 | ->validate() |
| 281 | - ->ifTrue(function ($widget) { |
|
| 281 | + ->ifTrue(function($widget) { |
|
| 282 | 282 | return [] === $widget; |
| 283 | 283 | }) |
| 284 | 284 | ->thenInvalid('Widget cannot be empty!') |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | $screenshotNodeDefinition |
| 310 | 310 | ->validate() |
| 311 | - ->ifTrue(function ($screenshot) { |
|
| 311 | + ->ifTrue(function($screenshot) { |
|
| 312 | 312 | return [] === $screenshot || ['path' => ''] === $screenshot; |
| 313 | 313 | }) |
| 314 | 314 | ->thenInvalid('Screenshot cannot be empty!') |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $screenshotNodeDefinition |
| 317 | 317 | ->beforeNormalization() |
| 318 | 318 | ->ifString() |
| 319 | - ->then(function ($value) { |
|
| 319 | + ->then(function($value) { |
|
| 320 | 320 | return ['path' => $value]; |
| 321 | 321 | }) |
| 322 | 322 | ; |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $authorNodeDefinition = $authorsNodeDefinition->prototype('array'); |
| 343 | 343 | $authorNodeDefinition |
| 344 | 344 | ->validate() |
| 345 | - ->ifTrue(function ($author) { |
|
| 345 | + ->ifTrue(function($author) { |
|
| 346 | 346 | return [] === $author; |
| 347 | 347 | }) |
| 348 | 348 | ->thenInvalid('Author cannot be empty!') |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $settingNodeDefinition = $settingsNodeDefinition->prototype('array'); |
| 371 | 371 | $settingNodeDefinition |
| 372 | 372 | ->validate() |
| 373 | - ->ifTrue(function ($setting) { |
|
| 373 | + ->ifTrue(function($setting) { |
|
| 374 | 374 | return [] === $setting; |
| 375 | 375 | }) |
| 376 | 376 | ->thenInvalid('Setting cannot be empty!') |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->initialized = true; |
| 89 | 89 | $stringyClass = new \ReflectionClass('Stringy\Stringy'); |
| 90 | 90 | $methods = $stringyClass->getMethods(\ReflectionMethod::IS_PUBLIC); |
| 91 | - $names = array_map(function ($value) { |
|
| 91 | + $names = array_map(function($value) { |
|
| 92 | 92 | return $value->getName(); |
| 93 | 93 | }, $methods); |
| 94 | 94 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if (array_key_exists($name, $this->environment->getFunctions())) { |
| 106 | 106 | continue; |
| 107 | 107 | } |
| 108 | - $this->functions[$name] = new \Twig_SimpleFunction($name, function () use ($name) { |
|
| 108 | + $this->functions[$name] = new \Twig_SimpleFunction($name, function() use ($name) { |
|
| 109 | 109 | return call_user_func_array(['Stringy\StaticStringy', $name], func_get_args()); |
| 110 | 110 | }); |
| 111 | 111 | } else { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | if (array_key_exists($name, $this->environment->getFilters())) { |
| 114 | 114 | continue; |
| 115 | 115 | } |
| 116 | - $this->filters[$name] = new \Twig_SimpleFilter($name, function () use ($name) { |
|
| 116 | + $this->filters[$name] = new \Twig_SimpleFilter($name, function() use ($name) { |
|
| 117 | 117 | return (string) call_user_func_array(['Stringy\StaticStringy', $name], func_get_args()); |
| 118 | 118 | }); |
| 119 | 119 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | ]) |
| 29 | 29 | ; |
| 30 | 30 | |
| 31 | - $formModifier = function (FormInterface $form, ?string $type) { |
|
| 31 | + $formModifier = function(FormInterface $form, ?string $type) { |
|
| 32 | 32 | if (OutputChannelInterface::TYPE_WORDPRESS === $type) { |
| 33 | 33 | $form->add('config', WordpressOutputChannelConfigType::class); |
| 34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $builder->addEventListener( |
| 38 | 38 | FormEvents::POST_SET_DATA, |
| 39 | - function (FormEvent $event) use ($formModifier) { |
|
| 39 | + function(FormEvent $event) use ($formModifier) { |
|
| 40 | 40 | $data = $event->getData(); |
| 41 | 41 | if (null !== $event->getData()) { |
| 42 | 42 | $formModifier($event->getForm(), $data->getType()); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $builder->get('type')->addEventListener( |
| 48 | 48 | FormEvents::POST_SUBMIT, |
| 49 | - function (FormEvent $event) use ($formModifier) { |
|
| 49 | + function(FormEvent $event) use ($formModifier) { |
|
| 50 | 50 | $type = $event->getForm()->getData(); |
| 51 | 51 | |
| 52 | 52 | $formModifier($event->getForm()->getParent(), $type); |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | { |
| 112 | 112 | if (!$input->getArgument($name)) { |
| 113 | 113 | $question = new Question(sprintf('<question>Please enter %s:</question>', $name)); |
| 114 | - $question->setValidator(function ($argument) use ($name) { |
|
| 114 | + $question->setValidator(function($argument) use ($name) { |
|
| 115 | 115 | if (empty($argument)) { |
| 116 | 116 | throw new \RuntimeException(sprintf('The %s can not be empty', $name)); |
| 117 | 117 | } |
@@ -64,10 +64,10 @@ |
||
| 64 | 64 | |
| 65 | 65 | $builder->get('filters') |
| 66 | 66 | ->addModelTransformer(new CallbackTransformer( |
| 67 | - function ($value) { |
|
| 67 | + function($value) { |
|
| 68 | 68 | return json_encode($value); |
| 69 | 69 | }, |
| 70 | - function ($value) { |
|
| 70 | + function($value) { |
|
| 71 | 71 | if (is_array($value)) { |
| 72 | 72 | return $value; |
| 73 | 73 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ->scalarNode('value') |
| 77 | 77 | ->beforeNormalization() |
| 78 | 78 | ->ifArray() |
| 79 | - ->then(function ($value) { |
|
| 79 | + ->then(function($value) { |
|
| 80 | 80 | return json_encode($value); |
| 81 | 81 | }) |
| 82 | 82 | ->end() |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ->scalarNode('type') |
| 86 | 86 | ->defaultValue('string') |
| 87 | 87 | ->validate() |
| 88 | - ->always(function ($v) { |
|
| 88 | + ->always(function($v) { |
|
| 89 | 89 | if (!in_array($v, ['string', 'array', 'boolean'])) { |
| 90 | 90 | throw new InvalidTypeException(); |
| 91 | 91 | } |