@@ -74,8 +74,8 @@ |
||
| 74 | 74 | |
| 75 | 75 | $section = $this->loadSectionFromPath($container); |
| 76 | 76 | |
| 77 | - $templateIdent = (string)$section->templateIdent(); |
|
| 78 | - $templateController = (string)$section->templateIdent(); |
|
| 77 | + $templateIdent = (string) $section->templateIdent(); |
|
| 78 | + $templateController = (string) $section->templateIdent(); |
|
| 79 | 79 | |
| 80 | 80 | if (!$templateController) { |
| 81 | 81 | return $response->withStatus(404); |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use InvalidArgumentException; |
| 6 | 6 | |
| 7 | 7 | // From 'charcoal-property' |
| 8 | -use Charcoal\Property\PropertyInterface; |
|
| 9 | 8 | use Charcoal\Property\StructureProperty; |
| 10 | 9 | use Charcoal\Property\TemplateProperty; |
| 11 | 10 | |
@@ -4,9 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use PDO; |
| 6 | 6 | |
| 7 | -use RuntimeException; |
|
| 8 | -use InvalidArgumentException; |
|
| 9 | - |
|
| 10 | 7 | // From Pimple |
| 11 | 8 | use Pimple\Container; |
| 12 | 9 | |
@@ -486,7 +486,7 @@ |
||
| 486 | 486 | $locales = []; |
| 487 | 487 | foreach ($fallbacks as $code) { |
| 488 | 488 | if (isset($available[$code])) { |
| 489 | - $locale = (array)$available[$code]['locale']; |
|
| 489 | + $locale = (array) $available[$code]['locale']; |
|
| 490 | 490 | array_push($locales, ...$locale); |
| 491 | 491 | } |
| 492 | 492 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Charcoal\Admin\Widget\Cms; |
| 4 | 4 | |
| 5 | -use Exception; |
|
| 6 | 5 | use RuntimeException; |
| 7 | 6 | |
| 8 | 7 | // From 'charcoal-core' |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | switch ($sectionType) { |
| 98 | 98 | case AbstractSection::TYPE_EXTERNAL: |
| 99 | - $externalUrl = (string)$object->externalUrl(); |
|
| 99 | + $externalUrl = (string) $object->externalUrl(); |
|
| 100 | 100 | $linkExcerpt = ''; |
| 101 | 101 | $tagTemplate = '<span class="glyphicon glyphicon-link" data-toggle="tooltip" '. |
| 102 | 102 | 'data-placement="auto" title="%1$s"></span>'; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ($propertyIdent === 'title') { |
| 126 | - if (is_callable([ $object, 'navMenu' ]) && $object->navMenu()) { |
|
| 126 | + if (is_callable([$object, 'navMenu']) && $object->navMenu()) { |
|
| 127 | 127 | $propertyValue .= sprintf( |
| 128 | 128 | ' '. |
| 129 | 129 | '<span class="glyphicon glyphicon-list" data-toggle="tooltip" '. |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | ); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - if (is_callable([ $object, 'locked' ]) && $object->locked()) { |
|
| 138 | + if (is_callable([$object, 'locked']) && $object->locked()) { |
|
| 139 | 139 | $propertyValue .= sprintf( |
| 140 | 140 | ' '. |
| 141 | 141 | '<span class="glyphicon glyphicon-lock" data-toggle="tooltip" '. |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use InvalidArgumentException; |
| 6 | 6 | |
| 7 | 7 | // From 'charcoal-core' |
| 8 | -use Charcoal\Model\Collection; |
|
| 9 | 8 | use Charcoal\Loader\CollectionLoader; |
| 10 | 9 | |
| 11 | 10 | // From 'charcoal-object' |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | parent::__construct($data); |
| 130 | 130 | |
| 131 | - if (is_callable([ $this, 'defaultData' ])) { |
|
| 131 | + if (is_callable([$this, 'defaultData'])) { |
|
| 132 | 132 | $this->setData($this->defaultData()); |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | * an empty string, or an object. |
| 491 | 491 | */ |
| 492 | 492 | if (!is_array($value)) { |
| 493 | - return [ $value ]; |
|
| 493 | + return [$value]; |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | return $value; |
@@ -10,10 +10,8 @@ |
||
| 10 | 10 | use Charcoal\Cms\Mixin\Traits\BlocksSectionTrait; |
| 11 | 11 | |
| 12 | 12 | // dependencies from `charcoal-core` |
| 13 | -use Charcoal\Loader\CollectionLoader; |
|
| 14 | 13 | |
| 15 | 14 | // dependencies from `pimple` |
| 16 | -use Pimple\Container; |
|
| 17 | 15 | |
| 18 | 16 | // dependencies from Psr-7 |
| 19 | 17 | use \RuntimeException; |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Charcoal\Loader\CollectionLoader; |
| 6 | 6 | use Charcoal\Object\ObjectRoute; |
| 7 | -use Exception; |
|
| 8 | 7 | |
| 9 | 8 | use \Charcoal\Translator\TranslatorAwareTrait; |
| 10 | 9 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $loader = $this->all(); |
| 73 | 73 | $operator = []; |
| 74 | 74 | if (!$this->baseSection()) { |
| 75 | - $operator = [ 'operator' => 'IS NULL' ]; |
|
| 75 | + $operator = ['operator' => 'IS NULL']; |
|
| 76 | 76 | } |
| 77 | 77 | $loader->addFilter('master', $this->baseSection(), $operator); |
| 78 | 78 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | $q = 'SELECT * FROM `'.$proto->source()->table().'` |
| 141 | 141 | WHERE active=1 AND ( ' |
| 142 | - . implode(' OR ', $filters) . ' ) |
|
| 142 | + . implode(' OR ', $filters).' ) |
|
| 143 | 143 | ORDER BY creation_date ASC'; |
| 144 | 144 | |
| 145 | 145 | $objectRoutes = $loader->loadFromQuery($q); |
@@ -12,13 +12,11 @@ |
||
| 12 | 12 | use Pimple\ServiceProviderInterface; |
| 13 | 13 | |
| 14 | 14 | // Local dependencies |
| 15 | -use Charcoal\Cms\Config; |
|
| 16 | 15 | |
| 17 | 16 | // Cms Loaders |
| 18 | 17 | use Charcoal\Cms\Service\Loader\SectionLoader; |
| 19 | 18 | |
| 20 | 19 | // dependencies from `charcoal-core` |
| 21 | -use Charcoal\Model\AbstractModel; |
|
| 22 | 20 | |
| 23 | 21 | // dependencies from `charcoal-cms` |
| 24 | 22 | use Charcoal\Cms\SectionInterface; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param Container $container |
| 52 | 52 | * @return CmsConfig Website configurations (from cms.json). |
| 53 | 53 | */ |
| 54 | - $container['cms/config'] = function (Container $container) { |
|
| 54 | + $container['cms/config'] = function(Container $container) { |
|
| 55 | 55 | $appConfig = $container['config']; |
| 56 | 56 | $cms = $appConfig->get('cms'); |
| 57 | 57 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param Container $container Pimple DI Container. |
| 84 | 84 | * @return DateHelper |
| 85 | 85 | */ |
| 86 | - $container['date/helper'] = function (Container $container) { |
|
| 86 | + $container['date/helper'] = function(Container $container) { |
|
| 87 | 87 | |
| 88 | 88 | return new DateHelper([ |
| 89 | 89 | 'date_formats' => $container['cms/config']->get('date_formats'), |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * @param Container $container Pimple DI Container. |
| 108 | 108 | * @return GenericFactory |
| 109 | 109 | */ |
| 110 | - $container['cms/section/factory'] = function (Container $container) { |
|
| 110 | + $container['cms/section/factory'] = function(Container $container) { |
|
| 111 | 111 | return new GenericFactory([ |
| 112 | 112 | 'base_class' => SectionInterface::class, |
| 113 | 113 | 'arguments' => $container['model/factory']->arguments(), |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * @param Container $container Pimple DI Container. |
| 122 | 122 | * @return SectionLoader |
| 123 | 123 | */ |
| 124 | - $container['cms/section/loader'] = function (Container $container) { |
|
| 124 | + $container['cms/section/loader'] = function(Container $container) { |
|
| 125 | 125 | $sectionLoader = new SectionLoader([ |
| 126 | 126 | 'loader' => $container['model/collection/loader'], |
| 127 | 127 | 'factory' => $container['model/factory'], |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param Container $container Pimple DI Container. |
| 151 | 151 | * @return NewsLoader |
| 152 | 152 | */ |
| 153 | - $container['cms/news/loader'] = function (Container $container) { |
|
| 153 | + $container['cms/news/loader'] = function(Container $container) { |
|
| 154 | 154 | $newsLoader = new NewsLoader([ |
| 155 | 155 | 'loader' => $container['model/collection/loader'], |
| 156 | 156 | 'factory' => $container['model/factory'], |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @param Container $container |
| 172 | 172 | * @return NewsManager |
| 173 | 173 | */ |
| 174 | - $container['cms/news/manager'] = function (Container $container) { |
|
| 174 | + $container['cms/news/manager'] = function(Container $container) { |
|
| 175 | 175 | |
| 176 | 176 | $newsManager = new NewsManager([ |
| 177 | 177 | 'loader' => $container['model/collection/loader'], |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * @param Container $container Pimple DI Container. |
| 197 | 197 | * @return EventLoader |
| 198 | 198 | */ |
| 199 | - $container['cms/event/loader'] = function (Container $container) { |
|
| 199 | + $container['cms/event/loader'] = function(Container $container) { |
|
| 200 | 200 | $eventLoader = new EventLoader([ |
| 201 | 201 | 'loader' => $container['model/collection/loader'], |
| 202 | 202 | 'factory' => $container['model/factory'], |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * @param Container $container |
| 218 | 218 | * @return EventManager |
| 219 | 219 | */ |
| 220 | - $container['cms/event/manager'] = function (Container $container) { |
|
| 220 | + $container['cms/event/manager'] = function(Container $container) { |
|
| 221 | 221 | |
| 222 | 222 | $eventManager = new EventManager([ |
| 223 | 223 | 'loader' => $container['model/collection/loader'], |