@@ -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 |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | protected function eventFormatShort(EventInterface $event) |
229 | 229 | { |
230 | 230 | return [ |
231 | - 'title' => (string)$event->title(), |
|
232 | - 'url' => (string)$event->url(), |
|
231 | + 'title' => (string) $event->title(), |
|
232 | + 'url' => (string) $event->url(), |
|
233 | 233 | 'startDate' => $this->getEventStartDateFormat($event), |
234 | 234 | 'startDateTime' => $event->startDate()->format('Y-m-d h:i'), |
235 | 235 | 'endDate' => $this->getEventEndDateFormat($event), |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | 'endDateTime' => $event->endDate()->format('Y-m-d h:i'), |
255 | 255 | 'date' => $this->getEventDateFormat($event), |
256 | 256 | 'time' => $this->getEventTimeFormat($event), |
257 | - 'title' => (string)$event->title(), |
|
257 | + 'title' => (string) $event->title(), |
|
258 | 258 | 'url' => $event->url() |
259 | 259 | ]; |
260 | 260 | } |
@@ -271,9 +271,9 @@ discard block |
||
271 | 271 | |
272 | 272 | return [ |
273 | 273 | 'id' => $event->id(), |
274 | - 'title' => (string)$event->title(), |
|
275 | - 'summary' => (string)$event->summary(), |
|
276 | - 'content' => (string)$event->content(), |
|
274 | + 'title' => (string) $event->title(), |
|
275 | + 'summary' => (string) $event->summary(), |
|
276 | + 'content' => (string) $event->content(), |
|
277 | 277 | 'image' => $event->image(), |
278 | 278 | 'startDate' => $this->getEventStartDateFormat($event), |
279 | 279 | 'startDateTime' => $event->startDate()->format('Y-m-d h:i'), |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | 'gallery' => $gallery, |
289 | 289 | 'hasGallery' => !!(count($gallery)), |
290 | 290 | 'url' => $event->url(), |
291 | - 'metaTitle' => (string)$event->metaTitle(), |
|
292 | - 'locationName' => (string)$event->locationName(), |
|
293 | - 'dateNotes' => (string)$event->dateNotes(), |
|
291 | + 'metaTitle' => (string) $event->metaTitle(), |
|
292 | + 'locationName' => (string) $event->locationName(), |
|
293 | + 'dateNotes' => (string) $event->dateNotes(), |
|
294 | 294 | 'category' => $event->category() |
295 | 295 | ]; |
296 | 296 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | { |
304 | 304 | return [ |
305 | 305 | 'id' => $category->id(), |
306 | - 'name' => (string)$category->name(), |
|
306 | + 'name' => (string) $category->name(), |
|
307 | 307 | ]; |
308 | 308 | } |
309 | 309 |
@@ -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]; |
@@ -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 |
@@ -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" '. |
@@ -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]; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param Container $container Pimple DI Container. |
61 | 61 | * @return CmsConfig Website configurations (from cms.json). |
62 | 62 | */ |
63 | - $container['cms/config'] = function (Container $container) { |
|
63 | + $container['cms/config'] = function(Container $container) { |
|
64 | 64 | $appConfig = $container['config']; |
65 | 65 | $cms = $appConfig->get('cms'); |
66 | 66 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param Container $container Pimple DI Container. |
96 | 96 | * @return DateHelper |
97 | 97 | */ |
98 | - $container['cms/date/helper'] = function (Container $container) { |
|
98 | + $container['cms/date/helper'] = function(Container $container) { |
|
99 | 99 | return new DateHelper([ |
100 | 100 | 'date_formats' => $container['cms/config']->get('date_formats'), |
101 | 101 | 'time_formats' => $container['cms/config']->get('time_formats'), |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param Container $container Pimple DI Container. |
108 | 108 | * @return DateHelper |
109 | 109 | */ |
110 | - $container['date/helper'] = function (Container $container) { |
|
110 | + $container['date/helper'] = function(Container $container) { |
|
111 | 111 | trigger_error(sprintf( |
112 | 112 | '%s is deprecated, use %s instead', |
113 | 113 | '$container[\'date/helper\']', |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param Container $container Pimple DI Container. |
129 | 129 | * @return Factory |
130 | 130 | */ |
131 | - $container['cms/section/factory'] = function (Container $container) { |
|
131 | + $container['cms/section/factory'] = function(Container $container) { |
|
132 | 132 | return new Factory([ |
133 | 133 | 'base_class' => SectionInterface::class, |
134 | 134 | 'arguments' => $container['model/factory']->arguments(), |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @param Container $container Pimple DI Container. |
143 | 143 | * @return SectionLoader |
144 | 144 | */ |
145 | - $container['cms/section/loader'] = function (Container $container) { |
|
145 | + $container['cms/section/loader'] = function(Container $container) { |
|
146 | 146 | $sectionLoader = new SectionLoader([ |
147 | 147 | 'loader' => $container['model/collection/loader'], |
148 | 148 | 'factory' => $container['model/factory'], |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param Container $container Pimple DI Container. |
172 | 172 | * @return NewsLoader |
173 | 173 | */ |
174 | - $container['cms/news/loader'] = function (Container $container) { |
|
174 | + $container['cms/news/loader'] = function(Container $container) { |
|
175 | 175 | $newsLoader = new NewsLoader([ |
176 | 176 | 'loader' => $container['model/collection/loader'], |
177 | 177 | 'factory' => $container['model/factory'], |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @param Container $container |
193 | 193 | * @return NewsManager |
194 | 194 | */ |
195 | - $container['cms/news/manager'] = function (Container $container) { |
|
195 | + $container['cms/news/manager'] = function(Container $container) { |
|
196 | 196 | |
197 | 197 | $newsManager = new NewsManager([ |
198 | 198 | 'loader' => $container['model/collection/loader'], |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @param Container $container Pimple DI Container. |
218 | 218 | * @return EventLoader |
219 | 219 | */ |
220 | - $container['cms/event/loader'] = function (Container $container) { |
|
220 | + $container['cms/event/loader'] = function(Container $container) { |
|
221 | 221 | $eventLoader = new EventLoader([ |
222 | 222 | 'loader' => $container['model/collection/loader'], |
223 | 223 | 'factory' => $container['model/factory'], |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @param Container $container |
242 | 242 | * @return EventManager |
243 | 243 | */ |
244 | - $container['cms/event/manager'] = function (Container $container) { |
|
244 | + $container['cms/event/manager'] = function(Container $container) { |
|
245 | 245 | |
246 | 246 | $eventManager = new EventManager([ |
247 | 247 | 'loader' => $container['model/collection/loader'], |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | parent::__construct($data); |
114 | 114 | |
115 | - if (is_callable([ $this, 'defaultData' ])) { |
|
115 | + if (is_callable([$this, 'defaultData'])) { |
|
116 | 116 | $this->setData($this->defaultData()); |
117 | 117 | } |
118 | 118 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function setTicketPriceMin($price) |
367 | 367 | { |
368 | - $this->ticketPriceMin = (float)$price; |
|
368 | + $this->ticketPriceMin = (float) $price; |
|
369 | 369 | return $this; |
370 | 370 | } |
371 | 371 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | public function setTicketPriceMax($price) |
385 | 385 | { |
386 | - $this->ticketPriceMax = (float)$price; |
|
386 | + $this->ticketPriceMax = (float) $price; |
|
387 | 387 | return $this; |
388 | 388 | } |
389 | 389 |