@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @param Container $container |
122 | 122 | * @return boolean |
123 | 123 | */ |
124 | - $container['debug'] = function (Container $container) { |
|
124 | + $container['debug'] = function(Container $container) { |
|
125 | 125 | if (isset($container['config']['debug'])) { |
126 | 126 | $debug = !!$container['config']['debug']; |
127 | 127 | } elseif (isset($container['config']['dev_mode'])) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @param Container $container |
143 | 143 | * @return \Psr\Http\Message\UriInterface |
144 | 144 | */ |
145 | - $container['base-url'] = function (Container $container) { |
|
145 | + $container['base-url'] = function(Container $container) { |
|
146 | 146 | if (isset($container['config']['base_url'])) { |
147 | 147 | $baseUrl = $container['config']['base_url']; |
148 | 148 | } else { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * @param Container $container A container instance. |
194 | 194 | * @return \Charcoal\App\Handler\HandlerInterface |
195 | 195 | */ |
196 | - $container->extend('notFoundHandler', function ($handler, Container $container) use ($handlersConfig) { |
|
196 | + $container->extend('notFoundHandler', function($handler, Container $container) use ($handlersConfig) { |
|
197 | 197 | if ($handler instanceof \Slim\Handlers\NotFound) { |
198 | 198 | $config = isset($handlersConfig['notFound']) ? $handlersConfig['notFound'] : []; |
199 | 199 | $class = $container['notFoundHandler/class']; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @param Container $container A container instance. |
214 | 214 | * @return \Charcoal\App\Handler\HandlerInterface |
215 | 215 | */ |
216 | - $container->extend('notAllowedHandler', function ($handler, Container $container) use ($handlersConfig) { |
|
216 | + $container->extend('notAllowedHandler', function($handler, Container $container) use ($handlersConfig) { |
|
217 | 217 | if ($handler instanceof \Slim\Handlers\NotAllowed) { |
218 | 218 | $config = isset($handlersConfig['notAllowed']) ? $handlersConfig['notAllowed'] : []; |
219 | 219 | $class = $container['notAllowedHandler/class']; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param Container $container A container instance. |
234 | 234 | * @return \Charcoal\App\Handler\HandlerInterface |
235 | 235 | */ |
236 | - $container->extend('phpErrorHandler', function ($handler, Container $container) use ($handlersConfig) { |
|
236 | + $container->extend('phpErrorHandler', function($handler, Container $container) use ($handlersConfig) { |
|
237 | 237 | if ($handler instanceof \Slim\Handlers\PhpError) { |
238 | 238 | $config = isset($handlersConfig['phpError']) ? $handlersConfig['phpError'] : []; |
239 | 239 | $class = $container['phpErrorHandler/class']; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param Container $container A container instance. |
254 | 254 | * @return \Charcoal\App\Handler\HandlerInterface |
255 | 255 | */ |
256 | - $container->extend('errorHandler', function ($handler, Container $container) use ($handlersConfig) { |
|
256 | + $container->extend('errorHandler', function($handler, Container $container) use ($handlersConfig) { |
|
257 | 257 | if ($handler instanceof \Slim\Handlers\Error) { |
258 | 258 | $config = isset($handlersConfig['error']) ? $handlersConfig['error'] : []; |
259 | 259 | $class = $container['errorHandler/class']; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * @param Container $container A Pimple DI container. |
275 | 275 | * @return \Charcoal\App\Handler\HandlerInterface |
276 | 276 | */ |
277 | - $container['maintenanceHandler'] = function (Container $container) use ($handlersConfig) { |
|
277 | + $container['maintenanceHandler'] = function(Container $container) use ($handlersConfig) { |
|
278 | 278 | $config = isset($handlersConfig['maintenance']) ? $handlersConfig['maintenance'] : []; |
279 | 279 | $class = $container['maintenanceHandler/class']; |
280 | 280 | $handler = new $class($container, $config); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * @param Container $container A container instance. |
303 | 303 | * @return \Charcoal\Factory\FactoryInterface |
304 | 304 | */ |
305 | - $container['route/factory'] = function (Container $container) { |
|
305 | + $container['route/factory'] = function(Container $container) { |
|
306 | 306 | return new Factory([ |
307 | 307 | 'base_class' => RouteInterface::class, |
308 | 308 | 'resolver_options' => [ |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * @param Container $container A container instance. |
347 | 347 | * @return \Charcoal\Factory\FactoryInterface |
348 | 348 | */ |
349 | - $container['action/factory'] = function (Container $container) { |
|
349 | + $container['action/factory'] = function(Container $container) { |
|
350 | 350 | return new Factory([ |
351 | 351 | 'base_class' => ActionInterface::class, |
352 | 352 | 'resolver_options' => [ |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | * @param Container $container A container instance. |
370 | 370 | * @return \Charcoal\Factory\FactoryInterface |
371 | 371 | */ |
372 | - $container['template/factory'] = function (Container $container) { |
|
372 | + $container['template/factory'] = function(Container $container) { |
|
373 | 373 | return new Factory([ |
374 | 374 | 'base_class' => TemplateInterface::class, |
375 | 375 | 'resolver_options' => [ |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | * @param Container $container A container instance. |
392 | 392 | * @return \Charcoal\Factory\FactoryInterface |
393 | 393 | */ |
394 | - $container['widget/factory'] = function (Container $container) { |
|
394 | + $container['widget/factory'] = function(Container $container) { |
|
395 | 395 | return new Factory([ |
396 | 396 | 'base_class' => WidgetInterface::class, |
397 | 397 | 'resolver_options' => [ |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | * @param Container $container A container instance. |
409 | 409 | * @return WidgetBuilder |
410 | 410 | */ |
411 | - $container['widget/builder'] = function (Container $container) { |
|
411 | + $container['widget/builder'] = function(Container $container) { |
|
412 | 412 | return new WidgetBuilder($container['widget/factory'], $container); |
413 | 413 | }; |
414 | 414 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @param Container $container A container instance. |
428 | 428 | * @return \Charcoal\Factory\FactoryInterface |
429 | 429 | */ |
430 | - $container['module/factory'] = function (Container $container) { |
|
430 | + $container['module/factory'] = function(Container $container) { |
|
431 | 431 | return new Factory([ |
432 | 432 | 'base_class' => ModuleInterface::class, |
433 | 433 | 'resolver_options' => [ |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | * @param Container $container A container instance. |
446 | 446 | * @return array |
447 | 447 | */ |
448 | - $container['module/classes'] = function (Container $container) { |
|
448 | + $container['module/classes'] = function(Container $container) { |
|
449 | 449 | $appConfig = $container['config']; |
450 | 450 | |
451 | 451 | $modules = $appConfig['modules']; |
@@ -455,11 +455,11 @@ discard block |
||
455 | 455 | 'suffix' => 'Module' |
456 | 456 | ]); |
457 | 457 | |
458 | - $modules = array_map(function ($module) use ($moduleResolver) { |
|
458 | + $modules = array_map(function($module) use ($moduleResolver) { |
|
459 | 459 | return $moduleResolver->resolve($module); |
460 | 460 | }, $modules); |
461 | 461 | |
462 | - array_filter($modules, function ($class) { |
|
462 | + array_filter($modules, function($class) { |
|
463 | 463 | return class_exists($class); |
464 | 464 | }); |
465 | 465 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | protected function registerViewServices(Container $container) |
477 | 477 | { |
478 | 478 | if (!isset($container['view/mustache/helpers'])) { |
479 | - $container['view/mustache/helpers'] = function () { |
|
479 | + $container['view/mustache/helpers'] = function() { |
|
480 | 480 | return []; |
481 | 481 | }; |
482 | 482 | } |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | * |
487 | 487 | * @return array |
488 | 488 | */ |
489 | - $container->extend('view/mustache/helpers', function (array $helpers, Container $container) { |
|
489 | + $container->extend('view/mustache/helpers', function(array $helpers, Container $container) { |
|
490 | 490 | $baseUrl = $container['base-url']; |
491 | 491 | $urls = [ |
492 | 492 | /** |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | * @param string $uri A URI path to wrap. |
514 | 514 | * @return UriInterface|null |
515 | 515 | */ |
516 | - 'withBaseUrl' => function ($uri, LambdaHelper $helper = null) use ($baseUrl) { |
|
516 | + 'withBaseUrl' => function($uri, LambdaHelper $helper = null) use ($baseUrl) { |
|
517 | 517 | if ($helper) { |
518 | 518 | $uri = $helper->render($uri); |
519 | 519 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | } else { |
525 | 525 | $parts = parse_url($uri); |
526 | 526 | if (!isset($parts['scheme'])) { |
527 | - if (!in_array($uri[0], [ '/', '#', '?' ])) { |
|
527 | + if (!in_array($uri[0], ['/', '#', '?'])) { |
|
528 | 528 | $path = isset($parts['path']) ? $parts['path'] : ''; |
529 | 529 | $query = isset($parts['query']) ? $parts['query'] : ''; |
530 | 530 | $hash = isset($parts['fragment']) ? $parts['fragment'] : ''; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | |
539 | 539 | return $uri; |
540 | 540 | }, |
541 | - 'renderContext' => function ($text, LambdaHelper $helper = null) { |
|
541 | + 'renderContext' => function($text, LambdaHelper $helper = null) { |
|
542 | 542 | return $helper->render('{{>'.$helper->render($text).'}}'); |
543 | 543 | } |
544 | 544 | ]; |