@@ -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 | { |
@@ -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 @@ |
||
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 | } |
@@ -10,10 +10,8 @@ |
||
10 | 10 | use Charcoal\Cms\Mixin\Traits\BlocksSectionTrait; |
11 | 11 | |
12 | 12 | // dependencies from `charcoal-core` |
13 | -use Charcoal\Loader\CollectionLoader; |
|
14 | 13 | |
15 | 14 | // dependencies from `pimple` |
16 | -use Pimple\Container; |
|
17 | 15 | |
18 | 16 | // dependencies from Psr-7 |
19 | 17 | use \RuntimeException; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * @param mixed $date The news date to filter |
|
88 | + * @param DateTime $date The news date to filter |
|
89 | 89 | * [startDate, endDate] |
90 | 90 | * DateTimeInterface |
91 | 91 | * string. |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | - * @param mixed $date The news date to filter |
|
104 | + * @param DateTime $date The news date to filter |
|
105 | 105 | * [startDate, endDate] |
106 | 106 | * DateTimeInterface |
107 | 107 | * string. |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | // ========================================================================== |
122 | 122 | |
123 | 123 | /** |
124 | - * @return mixed |
|
124 | + * @return string |
|
125 | 125 | */ |
126 | 126 | public function lifespan() |
127 | 127 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $now = new DateTime(); |
56 | 56 | $loader = $this->all(); |
57 | - $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]) |
|
57 | + $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), ['operator' => '<=']) |
|
58 | 58 | ->addOrder('start_date', 'asc'); |
59 | 59 | |
60 | 60 | return $loader; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $date = $this->parseAsDate($date); |
97 | 97 | $loader = $this->published(); |
98 | - $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]); |
|
98 | + $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), ['operator' => '>=']); |
|
99 | 99 | |
100 | 100 | return $loader; |
101 | 101 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $date = $this->parseAsDate($date); |
113 | 113 | $loader = $this->published(); |
114 | - $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '<' ]); |
|
114 | + $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), ['operator' => '<']); |
|
115 | 115 | |
116 | 116 | return $loader; |
117 | 117 | } |
@@ -213,7 +213,7 @@ |
||
213 | 213 | // ========================================================================== |
214 | 214 | |
215 | 215 | /** |
216 | - * @return object |
|
216 | + * @return string |
|
217 | 217 | */ |
218 | 218 | public function objType() |
219 | 219 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Charcoal\Loader\CollectionLoader; |
6 | 6 | use Charcoal\Object\ObjectRoute; |
7 | -use Exception; |
|
8 | 7 | |
9 | 8 | use \Charcoal\Translator\TranslatorAwareTrait; |
10 | 9 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $loader = $this->all(); |
73 | 73 | $operator = []; |
74 | 74 | if (!$this->baseSection()) { |
75 | - $operator = [ 'operator' => 'IS NULL' ]; |
|
75 | + $operator = ['operator' => 'IS NULL']; |
|
76 | 76 | } |
77 | 77 | $loader->addFilter('master', $this->baseSection(), $operator); |
78 | 78 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | $q = 'SELECT * FROM `'.$proto->source()->table().'` |
141 | 141 | WHERE active=1 AND ( ' |
142 | - . implode(' OR ', $filters) . ' ) |
|
142 | + . implode(' OR ', $filters).' ) |
|
143 | 143 | ORDER BY creation_date ASC'; |
144 | 144 | |
145 | 145 | $objectRoutes = $loader->loadFromQuery($q); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | /** |
232 | 232 | * @param integer|null $id The event id. |
233 | - * @return mixed |
|
233 | + * @return EventInterface |
|
234 | 234 | */ |
235 | 235 | public function entry($id = null) |
236 | 236 | { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | } |
399 | 399 | |
400 | 400 | /** |
401 | - * @return mixed The previous event |
|
401 | + * @return EventInterface The previous event |
|
402 | 402 | */ |
403 | 403 | public function prev() |
404 | 404 | { |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
413 | - * @return mixed The next event |
|
413 | + * @return EventInterface The next event |
|
414 | 414 | */ |
415 | 415 | public function next() |
416 | 416 | { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | |
505 | 505 | /** |
506 | 506 | * Amount of event (total) |
507 | - * @return integer How many event? |
|
507 | + * @return boolean How many event? |
|
508 | 508 | */ |
509 | 509 | public function numEvent() |
510 | 510 | { |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | } |
560 | 560 | |
561 | 561 | /** |
562 | - * @return mixed |
|
562 | + * @return string |
|
563 | 563 | */ |
564 | 564 | public function objType() |
565 | 565 | { |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | } |
568 | 568 | |
569 | 569 | /** |
570 | - * @return mixed |
|
570 | + * @return string |
|
571 | 571 | */ |
572 | 572 | public function featIdent() |
573 | 573 | { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | if ($this->category()) { |
219 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
219 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | if ($this->numPerPage()) { |
@@ -321,8 +321,8 @@ discard block |
||
321 | 321 | |
322 | 322 | $ids = explode(',', $ids); |
323 | 323 | |
324 | - $loader->addFilter('id', $ids, [ 'operator' => 'in' ]) |
|
325 | - ->addOrder('id', 'values', [ 'values' => $ids ]); |
|
324 | + $loader->addFilter('id', $ids, ['operator' => 'in']) |
|
325 | + ->addOrder('id', 'values', ['values' => $ids]); |
|
326 | 326 | |
327 | 327 | if (count($options) > 0) { |
328 | 328 | foreach ($options as $key => $option) { |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $loader = $this->loader()->archive(); |
370 | 370 | |
371 | 371 | if ($this->category()) { |
372 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
372 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
373 | 373 | } |
374 | 374 | if ($this->numPerPage()) { |
375 | 375 | $loader->setPage($this->page()); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | /** |
137 | 137 | * @param integer|null $id The news id. |
138 | - * @return mixed |
|
138 | + * @return NewsInterface |
|
139 | 139 | */ |
140 | 140 | public function entry($id = null) |
141 | 141 | { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
304 | - * @return mixed The previous news |
|
304 | + * @return NewsInterface The previous news |
|
305 | 305 | */ |
306 | 306 | public function prev() |
307 | 307 | { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
316 | - * @return mixed The next news |
|
316 | + * @return NewsInterface The next news |
|
317 | 317 | */ |
318 | 318 | public function next() |
319 | 319 | { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | |
386 | 386 | /** |
387 | 387 | * Amount of news (total) |
388 | - * @return integer How many news? |
|
388 | + * @return boolean How many news? |
|
389 | 389 | */ |
390 | 390 | public function numNews() |
391 | 391 | { |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | } |
449 | 449 | |
450 | 450 | /** |
451 | - * @return mixed |
|
451 | + * @return string |
|
452 | 452 | */ |
453 | 453 | public function featIdent() |
454 | 454 | { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $loader->addOrder('news_date', 'desc'); |
123 | 123 | |
124 | 124 | if ($this->category()) { |
125 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
125 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
126 | 126 | } |
127 | 127 | if ($this->numPerPage()) { |
128 | 128 | $loader->setPage($this->page()); |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | |
224 | 224 | $ids = explode(',', $ids); |
225 | 225 | |
226 | - $loader->addFilter('id', $ids, [ 'operator' => 'in' ]) |
|
227 | - ->addOrder('id', 'values', [ 'values' => $ids ]); |
|
226 | + $loader->addFilter('id', $ids, ['operator' => 'in']) |
|
227 | + ->addOrder('id', 'values', ['values' => $ids]); |
|
228 | 228 | |
229 | 229 | if (count($options) > 0) { |
230 | 230 | foreach ($options as $key => $option) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $loader->addOrder('news_date', 'desc'); |
273 | 273 | |
274 | 274 | if ($this->category()) { |
275 | - $loader->addFilter('category', $this->category(), [ 'operator' => 'in' ]); |
|
275 | + $loader->addFilter('category', $this->category(), ['operator' => 'in']); |
|
276 | 276 | } |
277 | 277 | if ($this->numPerPage()) { |
278 | 278 | $loader->setPage($this->page()); |
@@ -12,13 +12,11 @@ |
||
12 | 12 | use Pimple\ServiceProviderInterface; |
13 | 13 | |
14 | 14 | // Local dependencies |
15 | -use Charcoal\Cms\Config; |
|
16 | 15 | |
17 | 16 | // Cms Loaders |
18 | 17 | use Charcoal\Cms\Service\Loader\SectionLoader; |
19 | 18 | |
20 | 19 | // dependencies from `charcoal-core` |
21 | -use Charcoal\Model\AbstractModel; |
|
22 | 20 | |
23 | 21 | // dependencies from `charcoal-cms` |
24 | 22 | use Charcoal\Cms\SectionInterface; |
@@ -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 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param Container $container Pimple DI Container. |
84 | 84 | * @return DateHelper |
85 | 85 | */ |
86 | - $container['date/helper'] = function (Container $container) { |
|
86 | + $container['date/helper'] = function(Container $container) { |
|
87 | 87 | |
88 | 88 | return new DateHelper([ |
89 | 89 | 'date_formats' => $container['cms/config']->get('date_formats'), |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param Container $container Pimple DI Container. |
108 | 108 | * @return GenericFactory |
109 | 109 | */ |
110 | - $container['cms/section/factory'] = function (Container $container) { |
|
110 | + $container['cms/section/factory'] = function(Container $container) { |
|
111 | 111 | return new GenericFactory([ |
112 | 112 | 'base_class' => SectionInterface::class, |
113 | 113 | 'arguments' => $container['model/factory']->arguments(), |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @param Container $container Pimple DI Container. |
122 | 122 | * @return SectionLoader |
123 | 123 | */ |
124 | - $container['cms/section/loader'] = function (Container $container) { |
|
124 | + $container['cms/section/loader'] = function(Container $container) { |
|
125 | 125 | $sectionLoader = new SectionLoader([ |
126 | 126 | 'loader' => $container['model/collection/loader'], |
127 | 127 | 'factory' => $container['model/factory'], |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @param Container $container Pimple DI Container. |
151 | 151 | * @return NewsLoader |
152 | 152 | */ |
153 | - $container['cms/news/loader'] = function (Container $container) { |
|
153 | + $container['cms/news/loader'] = function(Container $container) { |
|
154 | 154 | $newsLoader = new NewsLoader([ |
155 | 155 | 'loader' => $container['model/collection/loader'], |
156 | 156 | 'factory' => $container['model/factory'], |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param Container $container |
172 | 172 | * @return NewsManager |
173 | 173 | */ |
174 | - $container['cms/news/manager'] = function (Container $container) { |
|
174 | + $container['cms/news/manager'] = function(Container $container) { |
|
175 | 175 | |
176 | 176 | $newsManager = new NewsManager([ |
177 | 177 | 'loader' => $container['model/collection/loader'], |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @param Container $container Pimple DI Container. |
197 | 197 | * @return EventLoader |
198 | 198 | */ |
199 | - $container['cms/event/loader'] = function (Container $container) { |
|
199 | + $container['cms/event/loader'] = function(Container $container) { |
|
200 | 200 | $eventLoader = new EventLoader([ |
201 | 201 | 'loader' => $container['model/collection/loader'], |
202 | 202 | 'factory' => $container['model/factory'], |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @param Container $container |
218 | 218 | * @return EventManager |
219 | 219 | */ |
220 | - $container['cms/event/manager'] = function (Container $container) { |
|
220 | + $container['cms/event/manager'] = function(Container $container) { |
|
221 | 221 | |
222 | 222 | $eventManager = new EventManager([ |
223 | 223 | 'loader' => $container['model/collection/loader'], |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Formatted event list |
29 | 29 | * Return the entries for the current page |
30 | - * @return \Generator|void |
|
30 | + * @return \Generator |
|
31 | 31 | */ |
32 | 32 | public function eventsList() |
33 | 33 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * Formatted event archive list |
43 | 43 | * Returns the entries for the current page. |
44 | - * @return \Generator|void |
|
44 | + * @return \Generator |
|
45 | 45 | */ |
46 | 46 | public function eventArchiveList() |
47 | 47 | { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * @return mixed |
|
76 | + * @return \Generator |
|
77 | 77 | */ |
78 | 78 | public function featEvents() |
79 | 79 | { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Amount of events (total) |
125 | - * @return integer How many events? |
|
125 | + * @return boolean How many events? |
|
126 | 126 | */ |
127 | 127 | public function numEvent() |
128 | 128 | { |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | protected function eventFormatShort(EventInterface $event) |
233 | 233 | { |
234 | 234 | return [ |
235 | - 'title' => (string)$event->title(), |
|
236 | - 'url' => (string)$event->url(), |
|
235 | + 'title' => (string) $event->title(), |
|
236 | + 'url' => (string) $event->url(), |
|
237 | 237 | 'startDate' => $this->getEventStartDateFormat($event), |
238 | 238 | 'endDate' => $this->getEventEndDateFormat($event), |
239 | 239 | 'date' => $this->getEventDateFormat($event), |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | 'endDate' => $this->getEventEndDateFormat($event), |
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 | 'endDate' => $this->getEventEndDateFormat($event), |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | 'gallery' => $gallery, |
287 | 287 | 'hasGallery' => !!(count($gallery)), |
288 | 288 | 'url' => $event->url(), |
289 | - 'metaTitle' => (string)$event->metaTitle(), |
|
290 | - 'locationName' => (string)$event->locationName(), |
|
291 | - 'dateNotes' => (string)$event->dateNotes(), |
|
289 | + 'metaTitle' => (string) $event->metaTitle(), |
|
290 | + 'locationName' => (string) $event->locationName(), |
|
291 | + 'dateNotes' => (string) $event->dateNotes(), |
|
292 | 292 | 'category' => $event->category() |
293 | 293 | ]; |
294 | 294 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | { |
302 | 302 | return [ |
303 | 303 | 'id' => $category->id(), |
304 | - 'name' => (string)$category->name(), |
|
304 | + 'name' => (string) $category->name(), |
|
305 | 305 | ]; |
306 | 306 | } |
307 | 307 |