@@ -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 |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * @return boolean Entry cycle. |
|
| 62 | + * @return string Entry cycle. |
|
| 63 | 63 | */ |
| 64 | 64 | public function entryCycle() |
| 65 | 65 | { |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
| 266 | - * @param mixed $format DateTime to be formatted. |
|
| 266 | + * @param string $format DateTime to be formatted. |
|
| 267 | 267 | * @return mixed |
| 268 | 268 | */ |
| 269 | 269 | private function crossPlatformFormat($format) |
@@ -199,18 +199,18 @@ discard block |
||
| 199 | 199 | ? $this->translator()->translation($case['formats']['to']) |
| 200 | 200 | : null; |
| 201 | 201 | |
| 202 | - $formats['from'] = $this->crossPlatformFormat((string)$formats['from']); |
|
| 203 | - $formats['to'] = $this->crossPlatformFormat((string)$formats['to']); |
|
| 202 | + $formats['from'] = $this->crossPlatformFormat((string) $formats['from']); |
|
| 203 | + $formats['to'] = $this->crossPlatformFormat((string) $formats['to']); |
|
| 204 | 204 | |
| 205 | 205 | if (!$this->to || !$formats['to']) { |
| 206 | 206 | return sprintf( |
| 207 | - (string)$content, |
|
| 207 | + (string) $content, |
|
| 208 | 208 | strftime($formats['from'], $this->from->getTimestamp()) |
| 209 | 209 | ); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | return sprintf( |
| 213 | - (string)$content, |
|
| 213 | + (string) $content, |
|
| 214 | 214 | strftime($formats['from'], $this->from->getTimestamp()), |
| 215 | 215 | strftime($formats['to'], $this->to->getTimestamp()) |
| 216 | 216 | ); |
@@ -235,13 +235,13 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | if (!$this->to || !$formats['to']) { |
| 237 | 237 | return sprintf( |
| 238 | - (string)$content, |
|
| 238 | + (string) $content, |
|
| 239 | 239 | strftime($formats['from'], $this->from->getTimestamp()) |
| 240 | 240 | ); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | return sprintf( |
| 244 | - (string)$content, |
|
| 244 | + (string) $content, |
|
| 245 | 245 | strftime($formats['from'], $this->from->getTimestamp()), |
| 246 | 246 | strftime($formats['to'], $this->to->getTimestamp()) |
| 247 | 247 | ); |
@@ -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 |
@@ -222,7 +222,7 @@ |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | - * @return object |
|
| 225 | + * @return string |
|
| 226 | 226 | */ |
| 227 | 227 | public function objType() |
| 228 | 228 | { |
@@ -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' |
@@ -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 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * @param string|DateTimeInterface|null $newsDate The news date. |
|
| 185 | + * @param string $newsDate The news date. |
|
| 186 | 186 | * @throws InvalidArgumentException If the timestamp is invalid. |
| 187 | 187 | * @return self |
| 188 | 188 | */ |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | /** |
| 309 | 309 | * @see MetatagTrait::defaultMetaDescription() |
| 310 | - * @return Translation|string|null |
|
| 310 | + * @return null|Translation |
|
| 311 | 311 | */ |
| 312 | 312 | public function defaultMetaDescription() |
| 313 | 313 | { |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * @return mixed |
|
| 58 | + * @return string[] |
|
| 59 | 59 | */ |
| 60 | 60 | public function name() |
| 61 | 61 | { |
@@ -31,7 +31,7 @@ discard block |
||
| 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 | } |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | parent::validate($v); |
| 83 | 83 | |
| 84 | 84 | foreach ($this->translator()->locales() as $locale => $value) { |
| 85 | - if (!isset($this['name']) || !(string)$this['name'][$locale]) { |
|
| 85 | + if (!isset($this['name']) || !(string) $this['name'][$locale]) { |
|
| 86 | 86 | $this->validator()->error( |
| 87 | - (string)$this->translator()->translation([ |
|
| 87 | + (string) $this->translator()->translation([ |
|
| 88 | 88 | 'fr' => 'Le NOM doit être rempli dans toutes les langues.', |
| 89 | 89 | 'en' => 'The NAME must be filled in all languages.', |
| 90 | 90 | ]) |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | // From 'charcoal-cms' |
| 6 | 6 | use Charcoal\Cms\AbstractSection; |
| 7 | -use Charcoal\Cms\Mixin\ContentSectionInterface; |
|
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * Content section |