@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | parent::__construct($data); |
| 130 | 130 | |
| 131 | - if (is_callable([ $this, 'defaultData' ])) { |
|
| 131 | + if (is_callable([$this, 'defaultData'])) { |
|
| 132 | 132 | $this->setData($this->defaultData()); |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | * an empty string, or an object. |
| 491 | 491 | */ |
| 492 | 492 | if (!is_array($value)) { |
| 493 | - return [ $value ]; |
|
| 493 | + return [$value]; |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | return $value; |
@@ -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 | } |
@@ -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 | } |
@@ -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); |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | $now = new DateTime(); |
| 49 | 49 | $loader = $this->all(); |
| 50 | - $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]) |
|
| 51 | - ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]); |
|
| 50 | + $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), ['operator' => '<=']) |
|
| 51 | + ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), ['operator' => '>=']); |
|
| 52 | 52 | |
| 53 | 53 | return $loader; |
| 54 | 54 | } |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | $now = new DateTime(); |
| 62 | 62 | $loader = $this->all(); |
| 63 | - $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]) |
|
| 64 | - ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]); |
|
| 63 | + $loader->addFilter('publish_date', $now->format('Y-m-d H:i:s'), ['operator' => '<=']) |
|
| 64 | + ->addFilter('expiry_date', $now->format('Y-m-d H:i:s'), ['operator' => '<=']); |
|
| 65 | 65 | |
| 66 | 66 | return $loader; |
| 67 | 67 | } |
@@ -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()); |
@@ -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()); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function routes() |
| 77 | 77 | { |
| 78 | - return function ($arg) { |
|
| 78 | + return function($arg) { |
|
| 79 | 79 | return $this->sectionLoader()->resolveRoute($arg); |
| 80 | 80 | }; |
| 81 | 81 | } |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | $documents = $section->attachments('document'); |
| 178 | 178 | |
| 179 | 179 | return [ |
| 180 | - 'title' => (string)$section->title(), |
|
| 181 | - 'summary' => (string)$section->summary(), |
|
| 182 | - 'image' => (string)$section->image(), |
|
| 183 | - 'content' => (string)$section->content(), |
|
| 180 | + 'title' => (string) $section->title(), |
|
| 181 | + 'summary' => (string) $section->summary(), |
|
| 182 | + 'image' => (string) $section->image(), |
|
| 183 | + 'content' => (string) $section->content(), |
|
| 184 | 184 | 'contentBlocks' => $contentBlocks, |
| 185 | 185 | 'gallery' => $gallery, |
| 186 | 186 | 'documents' => $documents |
@@ -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 | 'active' => ($this->currentNews() && ($this->currentNews()['id'] == $news->id())), |
| 199 | 199 | 'category' => $news->category(), |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | return [ |
| 212 | 212 | 'date' => $this->getNewsDateFormat($news), |
| 213 | - 'title' => (string)$news->title(), |
|
| 213 | + 'title' => (string) $news->title(), |
|
| 214 | 214 | 'url' => $news->url(), |
| 215 | 215 | 'category' => $news->category(), |
| 216 | 216 | 'categoryName' => $this->newsCategory($news)->name() |
@@ -229,9 +229,9 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | return [ |
| 231 | 231 | 'id' => $news->id(), |
| 232 | - 'title' => (string)$news->title(), |
|
| 233 | - 'summary' => (string)$news->summary(), |
|
| 234 | - 'content' => (string)$news->content(), |
|
| 232 | + 'title' => (string) $news->title(), |
|
| 233 | + 'summary' => (string) $news->summary(), |
|
| 234 | + 'content' => (string) $news->content(), |
|
| 235 | 235 | 'image' => $news->image(), |
| 236 | 236 | 'date' => $this->getNewsDateFormat($news), |
| 237 | 237 | 'contentBlocks' => $contentBlocks, |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | 'gallery' => $gallery, |
| 242 | 242 | 'hasGallery' => !!(count($gallery)), |
| 243 | 243 | 'url' => $news->url(), |
| 244 | - 'metaTitle' => (string)$news->metaTitle(), |
|
| 244 | + 'metaTitle' => (string) $news->metaTitle(), |
|
| 245 | 245 | 'category' => $news->category(), |
| 246 | 246 | 'categoryName' => $this->newsCategory($news)->name() |
| 247 | 247 | ]; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | { |
| 256 | 256 | return [ |
| 257 | 257 | 'id' => $category->id(), |
| 258 | - 'name' => (string)$category->name(), |
|
| 258 | + 'name' => (string) $category->name(), |
|
| 259 | 259 | ]; |
| 260 | 260 | } |
| 261 | 261 | |