@@ -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="fa fa-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="fa fa-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="fa fa-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' |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | { |
| 32 | 32 | parent::__construct($data); |
| 33 | 33 | |
| 34 | - if (is_callable([ $this, 'defaultData' ])) { |
|
| 34 | + if (is_callable([$this, 'defaultData'])) { |
|
| 35 | 35 | $this->setData($this->defaultData()); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | if ($this->category()) { |
| 219 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
| 219 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if ($this->numPerPage()) { |
@@ -321,8 +321,8 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | $ids = explode(',', $ids); |
| 323 | 323 | |
| 324 | - $loader->addFilter('id', $ids, [ 'operator' => 'in' ]) |
|
| 325 | - ->addOrder('id', 'values', [ 'values' => $ids ]); |
|
| 324 | + $loader->addFilter('id', $ids, ['operator' => 'in']) |
|
| 325 | + ->addOrder('id', 'values', ['values' => $ids]); |
|
| 326 | 326 | |
| 327 | 327 | if (count($options) > 0) { |
| 328 | 328 | foreach ($options as $key => $option) { |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $loader = $this->loader()->archive(); |
| 370 | 370 | |
| 371 | 371 | if ($this->category()) { |
| 372 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
| 372 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
| 373 | 373 | } |
| 374 | 374 | if ($this->numPerPage()) { |
| 375 | 375 | $loader->setPage($this->page()); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $loader->addOrder('news_date', 'desc'); |
| 123 | 123 | |
| 124 | 124 | if ($this->category()) { |
| 125 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
| 125 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
| 126 | 126 | } |
| 127 | 127 | if ($this->numPerPage()) { |
| 128 | 128 | $loader->setPage($this->page()); |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | $ids = explode(',', $ids); |
| 225 | 225 | |
| 226 | - $loader->addFilter('id', $ids, [ 'operator' => 'in' ]) |
|
| 227 | - ->addOrder('id', 'values', [ 'values' => $ids ]); |
|
| 226 | + $loader->addFilter('id', $ids, ['operator' => 'in']) |
|
| 227 | + ->addOrder('id', 'values', ['values' => $ids]); |
|
| 228 | 228 | |
| 229 | 229 | if (count($options) > 0) { |
| 230 | 230 | foreach ($options as $key => $option) { |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $loader->addOrder('news_date', 'desc'); |
| 273 | 273 | |
| 274 | 274 | if ($this->category()) { |
| 275 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
| 275 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
| 276 | 276 | } |
| 277 | 277 | if ($this->numPerPage()) { |
| 278 | 278 | $loader->setPage($this->page()); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function routes() |
| 77 | 77 | { |
| 78 | - return function ($arg) { |
|
| 78 | + return function($arg) { |
|
| 79 | 79 | return $this->sectionLoader()->resolveRoute($arg); |
| 80 | 80 | }; |
| 81 | 81 | } |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | $documents = $section->attachments('document'); |
| 178 | 178 | |
| 179 | 179 | return [ |
| 180 | - 'title' => (string)$section->title(), |
|
| 181 | - 'summary' => (string)$section->summary(), |
|
| 182 | - 'image' => (string)$section->image(), |
|
| 183 | - 'content' => (string)$section->content(), |
|
| 180 | + 'title' => (string) $section->title(), |
|
| 181 | + 'summary' => (string) $section->summary(), |
|
| 182 | + 'image' => (string) $section->image(), |
|
| 183 | + 'content' => (string) $section->content(), |
|
| 184 | 184 | 'contentBlocks' => $contentBlocks, |
| 185 | 185 | 'gallery' => $gallery, |
| 186 | 186 | 'documents' => $documents |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace Charcoal\Property; |
| 4 | 4 | |
| 5 | 5 | use PDO; |
| 6 | - |
|
| 7 | -use RuntimeException; |
|
| 8 | 6 | use InvalidArgumentException; |
| 9 | 7 | |
| 10 | 8 | // From Pimple |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $struct = $this->availableTemplates[$choiceIdent]; |
| 102 | - $immutable = [ 'value' => $struct['value'] ]; |
|
| 102 | + $immutable = ['value' => $struct['value']]; |
|
| 103 | 103 | |
| 104 | 104 | return array_replace($struct, $choice, $immutable); |
| 105 | 105 | } elseif (isset($choice['template']) || isset($choice['controller']) || isset($choice['class'])) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | return ''; |
| 140 | 140 | } |
| 141 | 141 | } elseif ($val instanceof Translation) { |
| 142 | - $propertyValue = (string)$val; |
|
| 142 | + $propertyValue = (string) $val; |
|
| 143 | 143 | } else { |
| 144 | 144 | $propertyValue = $val; |
| 145 | 145 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $val = $this->val(); |
| 188 | 188 | if ($this->hasChoice($val)) { |
| 189 | 189 | $choice = $this->choice($val); |
| 190 | - $keys = [ 'controller', 'template', 'class' ]; |
|
| 190 | + $keys = ['controller', 'template', 'class']; |
|
| 191 | 191 | foreach ($keys as $key) { |
| 192 | 192 | if (isset($choice[$key])) { |
| 193 | 193 | return $choice[$key]; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | $loader = $this->all(); |
| 74 | 74 | $operator = []; |
| 75 | 75 | if (!$this->baseSection()) { |
| 76 | - $operator = [ 'operator' => 'IS NULL' ]; |
|
| 76 | + $operator = ['operator' => 'IS NULL']; |
|
| 77 | 77 | } |
| 78 | 78 | $loader->addFilter('master', $this->baseSection(), $operator); |
| 79 | 79 | |
@@ -2,8 +2,6 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace Charcoal\Cms\Service\Loader; |
| 4 | 4 | |
| 5 | -use Exception; |
|
| 6 | - |
|
| 7 | 5 | // From 'charcoal-core' |
| 8 | 6 | use Charcoal\Loader\CollectionLoader; |
| 9 | 7 | |
@@ -11,7 +9,6 @@ discard block |
||
| 11 | 9 | use Charcoal\Object\ObjectRoute; |
| 12 | 10 | |
| 13 | 11 | // From 'charcoal-translator' |
| 14 | -use Charcoal\Translator\TranslatorAwareTrait; |
|
| 15 | 12 | |
| 16 | 13 | /** |
| 17 | 14 | * Section Loader |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function addStructureInterface($interface) |
| 35 | 35 | { |
| 36 | 36 | if ($interface instanceof TemplateProperty) { |
| 37 | - $interface = (string)$interface; |
|
| 37 | + $interface = (string) $interface; |
|
| 38 | 38 | if (empty($interface)) { |
| 39 | 39 | throw new InvalidArgumentException( |
| 40 | 40 | 'Invalid template structure interface' |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | protected function loadNewsFromPath(Container $container) |
| 119 | 119 | { |
| 120 | 120 | if (!$this->news) { |
| 121 | - $config = $this->config(); |
|
| 121 | + $config = $this->config(); |
|
| 122 | 122 | $type = (isset($config['obj_type']) ? $config['obj_type'] : $this->objType); |
| 123 | 123 | $model = $container['model/factory']->create($type); |
| 124 | 124 | |