@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * Gets latest route for the given slug. |
| 74 | - * @return string The latest url. |
|
| 74 | + * @return \Closure The latest url. |
|
| 75 | 75 | */ |
| 76 | 76 | public function routes() |
| 77 | 77 | { |
@@ -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 |
@@ -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 | } |
@@ -197,18 +197,18 @@ discard block |
||
| 197 | 197 | $formats['from'] = $this->translator()->translation($case['formats']['from']); |
| 198 | 198 | $formats['to'] = isset($case['formats']['to']) ? $this->translator()->translation($case['formats']['to']) : null; |
| 199 | 199 | |
| 200 | - $formats['from'] = $this->crossPlatformFormat((string)$formats['from']); |
|
| 201 | - $formats['to'] = $this->crossPlatformFormat((string)$formats['to']); |
|
| 200 | + $formats['from'] = $this->crossPlatformFormat((string) $formats['from']); |
|
| 201 | + $formats['to'] = $this->crossPlatformFormat((string) $formats['to']); |
|
| 202 | 202 | |
| 203 | 203 | if (!$this->to || !$formats['to']) { |
| 204 | 204 | return sprintf( |
| 205 | - (string)$content, |
|
| 205 | + (string) $content, |
|
| 206 | 206 | strftime($formats['from'], $this->from->getTimestamp()) |
| 207 | 207 | ); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | return sprintf( |
| 211 | - (string)$content, |
|
| 211 | + (string) $content, |
|
| 212 | 212 | strftime($formats['from'], $this->from->getTimestamp()), |
| 213 | 213 | strftime($formats['to'], $this->to->getTimestamp()) |
| 214 | 214 | ); |
@@ -233,13 +233,13 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | if (!$this->to || !$formats['to']) { |
| 235 | 235 | return sprintf( |
| 236 | - (string)$content, |
|
| 236 | + (string) $content, |
|
| 237 | 237 | strftime($formats['from'], $this->from->getTimestamp()) |
| 238 | 238 | ); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | return sprintf( |
| 242 | - (string)$content, |
|
| 242 | + (string) $content, |
|
| 243 | 243 | strftime($formats['from'], $this->from->getTimestamp()), |
| 244 | 244 | strftime($formats['to'], $this->to->getTimestamp()) |
| 245 | 245 | ); |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
| 266 | - * @param mixed $format DateTime to be formatted. |
|
| 266 | + * @param string $format DateTime to be formatted. |
|
| 267 | 267 | * @return mixed |
| 268 | 268 | */ |
| 269 | 269 | private function crossPlatformFormat($format) |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | - * @param string|DateTimeInterface $startDate Event starting date. |
|
| 233 | + * @param string $startDate Event starting date. |
|
| 234 | 234 | * @throws InvalidArgumentException If the timestamp is invalid. |
| 235 | 235 | * @return self |
| 236 | 236 | */ |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
| 266 | - * @param string|DateTimeInterface $endDate Event end date. |
|
| 266 | + * @param null|DateTimeInterface $endDate Event end date. |
|
| 267 | 267 | * @throws InvalidArgumentException If the timestamp is invalid. |
| 268 | 268 | * @return self |
| 269 | 269 | */ |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | - * @return Translation|string|null |
|
| 322 | + * @return null|Translation |
|
| 323 | 323 | */ |
| 324 | 324 | public function defaultMetaDescription() |
| 325 | 325 | { |
@@ -7,8 +7,6 @@ discard block |
||
| 7 | 7 | use InvalidArgumentException; |
| 8 | 8 | |
| 9 | 9 | // From PSR-7 |
| 10 | -use Psr\Http\Message\RequestInterface; |
|
| 11 | -use Psr\Http\Message\ResponseInterface; |
|
| 12 | 10 | |
| 13 | 11 | // From 'charcoal-object' |
| 14 | 12 | use Charcoal\Object\Content; |
@@ -26,7 +24,6 @@ discard block |
||
| 26 | 24 | use Charcoal\Cms\MetatagInterface; |
| 27 | 25 | use Charcoal\Cms\SearchableInterface; |
| 28 | 26 | use Charcoal\Cms\TemplateableInterface; |
| 29 | - |
|
| 30 | 27 | use Charcoal\Cms\MetatagTrait; |
| 31 | 28 | use Charcoal\Cms\SearchableTrait; |
| 32 | 29 | use Charcoal\Cms\TemplateableTrait; |
@@ -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 | } |
@@ -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 | { |