@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Charcoal\Admin\Widget\Cms; |
| 4 | 4 | |
| 5 | -use Exception; |
|
| 6 | 5 | use RuntimeException; |
| 7 | 6 | |
| 8 | 7 | // From 'charcoal-core' |
@@ -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" '. |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | /** |
| 364 | 364 | * Retrieve the menus this object belongs to. |
| 365 | 365 | * |
| 366 | - * @return Translation|string|null |
|
| 366 | + * @return string[] |
|
| 367 | 367 | */ |
| 368 | 368 | public function inMenu() |
| 369 | 369 | { |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | /** |
| 433 | - * @return Translation|string|null |
|
| 433 | + * @return null|Translation |
|
| 434 | 434 | */ |
| 435 | 435 | public function defaultMetaDescription() |
| 436 | 436 | { |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use InvalidArgumentException; |
| 6 | 6 | |
| 7 | 7 | // From 'charcoal-core' |
| 8 | -use Charcoal\Model\Collection; |
|
| 9 | 8 | use Charcoal\Loader\CollectionLoader; |
| 10 | 9 | |
| 11 | 10 | // From 'charcoal-object' |
@@ -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 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // ========================================================================== |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * @return mixed |
|
| 86 | + * @return string |
|
| 87 | 87 | */ |
| 88 | 88 | public function defaultMetaTitle() |
| 89 | 89 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | - * @return mixed |
|
| 94 | + * @return string |
|
| 95 | 95 | */ |
| 96 | 96 | public function defaultMetaDescription() |
| 97 | 97 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * @return mixed |
|
| 102 | + * @return string |
|
| 103 | 103 | */ |
| 104 | 104 | public function defaultMetaImage() |
| 105 | 105 | { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * @return mixed |
|
| 110 | + * @return string |
|
| 111 | 111 | */ |
| 112 | 112 | public function defaultMetaUrl() |
| 113 | 113 | { |
@@ -232,7 +232,7 @@ |
||
| 232 | 232 | // ========================================================================== |
| 233 | 233 | |
| 234 | 234 | /** |
| 235 | - * @return mixed |
|
| 235 | + * @return string |
|
| 236 | 236 | */ |
| 237 | 237 | public function defaultFromEmail() |
| 238 | 238 | { |
@@ -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 @@ discard block |
||
| 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 | } |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | parent::validate($v); |
| 83 | 83 | |
| 84 | 84 | foreach ($this->translator()->locales() as $locale => $value) { |
| 85 | - if (!(string)$this['name'][$locale]) { |
|
| 85 | + if (!(string) $this['name'][$locale]) { |
|
| 86 | 86 | $this->validator()->error( |
| 87 | - (string)$this->translator()->translation([ |
|
| 87 | + (string) $this->translator()->translation([ |
|
| 88 | 88 | 'fr' => 'Le NOM doit être rempli dans toutes les langues.', |
| 89 | 89 | 'en' => 'The NAME must be filled in all languages.', |
| 90 | 90 | ]) |
@@ -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 | { |
@@ -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 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Formatted news list |
| 34 | 34 | * Returns the entries for the current page. |
| 35 | - * @return \Generator|void |
|
| 35 | + * @return \Generator |
|
| 36 | 36 | */ |
| 37 | 37 | public function newsList() |
| 38 | 38 | { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * Formatted news archive list |
| 47 | 47 | * Returns the entries for the current page. |
| 48 | - * @return \Generator|void |
|
| 48 | + * @return \Generator |
|
| 49 | 49 | */ |
| 50 | 50 | public function newsArchiveList() |
| 51 | 51 | { |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | 126 | * Amount of news (total) |
| 127 | - * @return integer How many news? |
|
| 127 | + * @return boolean How many news? |
|
| 128 | 128 | */ |
| 129 | 129 | public function numNews() |
| 130 | 130 | { |
@@ -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 | |
@@ -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()); |
@@ -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 | { |
@@ -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 | { |