@@ -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 | ]) |
@@ -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 | ]) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param Container $container |
| 48 | 48 | * @return CmsConfig Website configurations (from cms.json). |
| 49 | 49 | */ |
| 50 | - $container['cms/config'] = function (Container $container) { |
|
| 50 | + $container['cms/config'] = function(Container $container) { |
|
| 51 | 51 | $appConfig = $container['config']; |
| 52 | 52 | $cms = $appConfig->get('cms'); |
| 53 | 53 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param Container $container Pimple DI Container. |
| 81 | 81 | * @return DateHelper |
| 82 | 82 | */ |
| 83 | - $container['cms/date/helper'] = function (Container $container) { |
|
| 83 | + $container['cms/date/helper'] = function(Container $container) { |
|
| 84 | 84 | return new DateHelper([ |
| 85 | 85 | 'date_formats' => $container['cms/config']->get('date_formats'), |
| 86 | 86 | 'time_formats' => $container['cms/config']->get('time_formats'), |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @param Container $container Pimple DI Container. |
| 93 | 93 | * @return DateHelper |
| 94 | 94 | */ |
| 95 | - $container['date/helper'] = function (Container $container) { |
|
| 95 | + $container['date/helper'] = function(Container $container) { |
|
| 96 | 96 | trigger_error(sprintf( |
| 97 | 97 | '%s is deprecated, use %s instead', |
| 98 | 98 | '$container[\'date/helper\']', |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @param Container $container Pimple DI Container. |
| 118 | 118 | * @return Factory |
| 119 | 119 | */ |
| 120 | - $container['cms/section/factory'] = function (Container $container) { |
|
| 120 | + $container['cms/section/factory'] = function(Container $container) { |
|
| 121 | 121 | return new Factory([ |
| 122 | 122 | 'base_class' => SectionInterface::class, |
| 123 | 123 | 'arguments' => $container['model/factory']->arguments(), |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * @param Container $container Pimple DI Container. |
| 132 | 132 | * @return SectionLoader |
| 133 | 133 | */ |
| 134 | - $container['cms/section/loader'] = function (Container $container) { |
|
| 134 | + $container['cms/section/loader'] = function(Container $container) { |
|
| 135 | 135 | $sectionLoader = new SectionLoader([ |
| 136 | 136 | 'loader' => $container['model/collection/loader'], |
| 137 | 137 | 'factory' => $container['model/factory'], |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param Container $container Pimple DI Container. |
| 161 | 161 | * @return NewsLoader |
| 162 | 162 | */ |
| 163 | - $container['cms/news/loader'] = function (Container $container) { |
|
| 163 | + $container['cms/news/loader'] = function(Container $container) { |
|
| 164 | 164 | $newsLoader = new NewsLoader([ |
| 165 | 165 | 'loader' => $container['model/collection/loader'], |
| 166 | 166 | 'factory' => $container['model/factory'], |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * @param Container $container |
| 182 | 182 | * @return NewsManager |
| 183 | 183 | */ |
| 184 | - $container['cms/news/manager'] = function (Container $container) { |
|
| 184 | + $container['cms/news/manager'] = function(Container $container) { |
|
| 185 | 185 | |
| 186 | 186 | $newsManager = new NewsManager([ |
| 187 | 187 | 'loader' => $container['model/collection/loader'], |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * @param Container $container Pimple DI Container. |
| 207 | 207 | * @return EventLoader |
| 208 | 208 | */ |
| 209 | - $container['cms/event/loader'] = function (Container $container) { |
|
| 209 | + $container['cms/event/loader'] = function(Container $container) { |
|
| 210 | 210 | $eventLoader = new EventLoader([ |
| 211 | 211 | 'loader' => $container['model/collection/loader'], |
| 212 | 212 | 'factory' => $container['model/factory'], |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | * @param Container $container |
| 231 | 231 | * @return EventManager |
| 232 | 232 | */ |
| 233 | - $container['cms/event/manager'] = function (Container $container) { |
|
| 233 | + $container['cms/event/manager'] = function(Container $container) { |
|
| 234 | 234 | |
| 235 | 235 | $eventManager = new EventManager([ |
| 236 | 236 | 'loader' => $container['model/collection/loader'], |
@@ -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]; |