@@ -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 | |
@@ -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); |
@@ -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 | ); |
@@ -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 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @param Container $container Pimple DI Container. |
| 85 | 85 | * @return DateHelper |
| 86 | 86 | */ |
| 87 | - $container['cms/date/helper'] = function (Container $container) { |
|
| 87 | + $container['cms/date/helper'] = function(Container $container) { |
|
| 88 | 88 | return new DateHelper([ |
| 89 | 89 | 'date_formats' => $container['cms/config']->get('date_formats'), |
| 90 | 90 | 'time_formats' => $container['cms/config']->get('time_formats'), |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @param Container $container Pimple DI Container. |
| 97 | 97 | * @return DateHelper |
| 98 | 98 | */ |
| 99 | - $container['date/helper'] = function (Container $container) { |
|
| 99 | + $container['date/helper'] = function(Container $container) { |
|
| 100 | 100 | trigger_error(sprintf( |
| 101 | 101 | '%s is deprecated, use %s instead', |
| 102 | 102 | '$container[\'date/helper\']', |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * @param Container $container Pimple DI Container. |
| 122 | 122 | * @return GenericFactory |
| 123 | 123 | */ |
| 124 | - $container['cms/section/factory'] = function (Container $container) { |
|
| 124 | + $container['cms/section/factory'] = function(Container $container) { |
|
| 125 | 125 | return new GenericFactory([ |
| 126 | 126 | 'base_class' => SectionInterface::class, |
| 127 | 127 | 'arguments' => $container['model/factory']->arguments(), |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * @param Container $container Pimple DI Container. |
| 136 | 136 | * @return SectionLoader |
| 137 | 137 | */ |
| 138 | - $container['cms/section/loader'] = function (Container $container) { |
|
| 138 | + $container['cms/section/loader'] = function(Container $container) { |
|
| 139 | 139 | $sectionLoader = new SectionLoader([ |
| 140 | 140 | 'loader' => $container['model/collection/loader'], |
| 141 | 141 | 'factory' => $container['model/factory'], |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * @param Container $container Pimple DI Container. |
| 165 | 165 | * @return NewsLoader |
| 166 | 166 | */ |
| 167 | - $container['cms/news/loader'] = function (Container $container) { |
|
| 167 | + $container['cms/news/loader'] = function(Container $container) { |
|
| 168 | 168 | $newsLoader = new NewsLoader([ |
| 169 | 169 | 'loader' => $container['model/collection/loader'], |
| 170 | 170 | 'factory' => $container['model/factory'], |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * @param Container $container |
| 186 | 186 | * @return NewsManager |
| 187 | 187 | */ |
| 188 | - $container['cms/news/manager'] = function (Container $container) { |
|
| 188 | + $container['cms/news/manager'] = function(Container $container) { |
|
| 189 | 189 | |
| 190 | 190 | $newsManager = new NewsManager([ |
| 191 | 191 | 'loader' => $container['model/collection/loader'], |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * @param Container $container Pimple DI Container. |
| 211 | 211 | * @return EventLoader |
| 212 | 212 | */ |
| 213 | - $container['cms/event/loader'] = function (Container $container) { |
|
| 213 | + $container['cms/event/loader'] = function(Container $container) { |
|
| 214 | 214 | $eventLoader = new EventLoader([ |
| 215 | 215 | 'loader' => $container['model/collection/loader'], |
| 216 | 216 | 'factory' => $container['model/factory'], |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @param Container $container |
| 235 | 235 | * @return EventManager |
| 236 | 236 | */ |
| 237 | - $container['cms/event/manager'] = function (Container $container) { |
|
| 237 | + $container['cms/event/manager'] = function(Container $container) { |
|
| 238 | 238 | |
| 239 | 239 | $eventManager = new EventManager([ |
| 240 | 240 | 'loader' => $container['model/collection/loader'], |
@@ -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 | } |
@@ -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 | } |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | protected function newsFormatShort(NewsInterface $news) |
| 193 | 193 | { |
| 194 | 194 | return [ |
| 195 | - 'title' => (string)$news->title(), |
|
| 196 | - 'url' => (string)$news->url(), |
|
| 195 | + 'title' => (string) $news->title(), |
|
| 196 | + 'url' => (string) $news->url(), |
|
| 197 | 197 | 'date' => $this->getNewsDateFormat($news), |
| 198 | 198 | 'dateTime' => $news->newsDate()->format('Y-m-d h:i'), |
| 199 | 199 | 'active' => ($this->currentNews() && ($this->currentNews()['id'] == $news->id())), |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | return [ |
| 213 | 213 | 'date' => $this->getNewsDateFormat($news), |
| 214 | 214 | 'dateTime' => $news->newsDate()->format('Y-m-d h:i'), |
| 215 | - 'title' => (string)$news->title(), |
|
| 215 | + 'title' => (string) $news->title(), |
|
| 216 | 216 | 'url' => $news->url(), |
| 217 | 217 | 'category' => $news->category(), |
| 218 | 218 | 'categoryName' => $this->newsCategory($news)->name() |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | return [ |
| 233 | 233 | 'id' => $news->id(), |
| 234 | - 'title' => (string)$news->title(), |
|
| 235 | - 'summary' => (string)$news->summary(), |
|
| 236 | - 'content' => (string)$news->content(), |
|
| 234 | + 'title' => (string) $news->title(), |
|
| 235 | + 'summary' => (string) $news->summary(), |
|
| 236 | + 'content' => (string) $news->content(), |
|
| 237 | 237 | 'image' => $news->image(), |
| 238 | 238 | 'date' => $this->getNewsDateFormat($news), |
| 239 | 239 | 'dateTime' => $news->newsDate()->format('Y-m-d h:i'), |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | 'gallery' => $gallery, |
| 245 | 245 | 'hasGallery' => !!(count($gallery)), |
| 246 | 246 | 'url' => $news->url(), |
| 247 | - 'metaTitle' => (string)$news->metaTitle(), |
|
| 247 | + 'metaTitle' => (string) $news->metaTitle(), |
|
| 248 | 248 | 'category' => $news->category(), |
| 249 | 249 | 'categoryName' => $this->newsCategory($news)->name() |
| 250 | 250 | ]; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | { |
| 259 | 259 | return [ |
| 260 | 260 | 'id' => $category->id(), |
| 261 | - 'name' => (string)$category->name(), |
|
| 261 | + 'name' => (string) $category->name(), |
|
| 262 | 262 | ]; |
| 263 | 263 | } |
| 264 | 264 | |