@@ -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 | |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | protected function loadEventFromPath(Container $container) |
| 119 | 119 | { |
| 120 | 120 | if (!$this->event) { |
| 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 | |
@@ -88,8 +88,8 @@ |
||
| 88 | 88 | return $response->withStatus(404); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $templateIdent = (string)$section->templateIdent(); |
|
| 92 | - $templateController = (string)$section->templateIdent(); |
|
| 91 | + $templateIdent = (string) $section->templateIdent(); |
|
| 92 | + $templateController = (string) $section->templateIdent(); |
|
| 93 | 93 | |
| 94 | 94 | if (!$templateController) { |
| 95 | 95 | return $response->withStatus(404); |
@@ -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 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | - * @param string|DateTimeInterface|null $newsDate The news date. |
|
| 184 | + * @param string $newsDate The news date. |
|
| 185 | 185 | * @throws InvalidArgumentException If the timestamp is invalid. |
| 186 | 186 | * @return self |
| 187 | 187 | */ |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
| 297 | - * @return Translation|string|null |
|
| 297 | + * @return null|Translation |
|
| 298 | 298 | */ |
| 299 | 299 | public function defaultMetaDescription() |
| 300 | 300 | { |
@@ -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 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | parent::__construct($data); |
| 36 | 36 | |
| 37 | - if (is_callable([ $this, 'defaultData' ])) { |
|
| 37 | + if (is_callable([$this, 'defaultData'])) { |
|
| 38 | 38 | $this->setData($this->defaultData()); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | parent::validate($v); |
| 89 | 89 | |
| 90 | 90 | foreach ($this->translator()->locales() as $locale => $value) { |
| 91 | - if (!(string)$this->name()[$locale]) { |
|
| 91 | + if (!(string) $this->name()[$locale]) { |
|
| 92 | 92 | $this->validator()->error( |
| 93 | - (string)$this->translator()->translation([ |
|
| 93 | + (string) $this->translator()->translation([ |
|
| 94 | 94 | 'fr' => 'Le NOM doit être rempli dans toutes les langues.', |
| 95 | 95 | 'en' => 'The NAME must be filled in all languages.', |
| 96 | 96 | ]) |
@@ -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 |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | // From 'charcoal-cms' |
| 6 | 6 | use Charcoal\Cms\AbstractSection; |
| 7 | -use Charcoal\Cms\Mixin\EmptySectionInterface; |
|
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * Empty section |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | /** |
| 87 | 87 | * Retrieve the renderable object's template identifier. |
| 88 | 88 | * |
| 89 | - * @return mixed |
|
| 89 | + * @return string |
|
| 90 | 90 | */ |
| 91 | 91 | public function templateIdent() |
| 92 | 92 | { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | if ($property instanceof SelectablePropertyInterface) { |
| 108 | 108 | if ($property->hasChoice($templateIdent)) { |
| 109 | 109 | $choice = $property->choice($templateIdent); |
| 110 | - $keys = [ 'controller', 'template', 'class' ]; |
|
| 110 | + $keys = ['controller', 'template', 'class']; |
|
| 111 | 111 | foreach ($keys as $key) { |
| 112 | 112 | if (isset($choice[$key])) { |
| 113 | 113 | return $choice[$key]; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | public function hasTemplateOptions() |
| 184 | 184 | { |
| 185 | 185 | if ($this->templateOptionsStructure()) { |
| 186 | - return (bool)count( |
|
| 186 | + return (bool) count( |
|
| 187 | 187 | iterator_to_array( |
| 188 | 188 | $this->templateOptionsStructure()->properties() |
| 189 | 189 | ) |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $struct = $property->structureVal($obj[$propertyIdent]); |
| 246 | 246 | |
| 247 | 247 | /** Provide support for dynamically wrapping translation sets. */ |
| 248 | - if (in_array(get_class($struct), [ Model::class, StructureModel::class ])) { |
|
| 248 | + if (in_array(get_class($struct), [Model::class, StructureModel::class])) { |
|
| 249 | 249 | $struct = $this->translateTemplateOptionsModel($struct); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | if ($property instanceof SelectablePropertyInterface) { |
| 291 | 291 | if ($property->hasChoice($val)) { |
| 292 | 292 | $choice = $property->choice($val); |
| 293 | - $keys = [ 'controller', 'template', 'class' ]; |
|
| 293 | + $keys = ['controller', 'template', 'class']; |
|
| 294 | 294 | foreach ($keys as $key) { |
| 295 | 295 | if (isset($choice[$key])) { |
| 296 | 296 | $interface = $choice[$key]; |
@@ -200,7 +200,7 @@ |
||
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $attachmentWidgets = $structureMetadata->get('attachments.widgets'); |
| 203 | - foreach ((array)$attachmentWidgets as $ident => $metadata) { |
|
| 203 | + foreach ((array) $attachmentWidgets as $ident => $metadata) { |
|
| 204 | 204 | $this->addGroup($ident, $metadata); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -238,7 +238,7 @@ |
||
| 238 | 238 | /** |
| 239 | 239 | * Retrieve the form object's template controller identifier. |
| 240 | 240 | * |
| 241 | - * @return mixed |
|
| 241 | + * @return string |
|
| 242 | 242 | */ |
| 243 | 243 | public function controllerIdent() |
| 244 | 244 | { |