@@ -197,11 +197,11 @@ discard block |
||
| 197 | 197 | $title = null; |
| 198 | 198 | |
| 199 | 199 | if ($context instanceof MetatagInterface) { |
| 200 | - $title = (string)$context['metaTitle']; |
|
| 200 | + $title = (string) $context['metaTitle']; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | if (!$title) { |
| 204 | - $title = (string)$this->fallbackMetaTitle(); |
|
| 204 | + $title = (string) $this->fallbackMetaTitle(); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | return $title; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | protected function fallbackMetaTitle() |
| 218 | 218 | { |
| 219 | - return (string)$this->title(); |
|
| 219 | + return (string) $this->title(); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -230,11 +230,11 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | $desc = null; |
| 232 | 232 | if ($context instanceof MetatagInterface) { |
| 233 | - $desc = (string)$context['metaDescription']; |
|
| 233 | + $desc = (string) $context['metaDescription']; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if (!$desc) { |
| 237 | - $desc = (string)$this->fallbackMetaDescription(); |
|
| 237 | + $desc = (string) $this->fallbackMetaDescription(); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | return $desc; |
@@ -263,11 +263,11 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | $img = null; |
| 265 | 265 | if ($context instanceof MetatagInterface) { |
| 266 | - $img = (string)$context['metaImage']; |
|
| 266 | + $img = (string) $context['metaImage']; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | if (!$img) { |
| 270 | - $img = (string)$this->fallbackMetaImage(); |
|
| 270 | + $img = (string) $this->fallbackMetaImage(); |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | return $this->resolveMetaImage($img); |
@@ -342,11 +342,11 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | $img = null; |
| 344 | 344 | if ($context instanceof MetatagInterface) { |
| 345 | - $img = (string)$context['opengraphImage']; |
|
| 345 | + $img = (string) $context['opengraphImage']; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | if (!$img) { |
| 349 | - $img = (string)$this->fallbackOpengraphImage(); |
|
| 349 | + $img = (string) $this->fallbackOpengraphImage(); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | if ($img) { |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | $this->seoMetadata[] = [ |
| 414 | 414 | 'name' => $key, |
| 415 | - 'content' => (string)$value |
|
| 415 | + 'content' => (string) $value |
|
| 416 | 416 | ]; |
| 417 | 417 | } |
| 418 | 418 | |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | } else { |
| 508 | 508 | $parts = parse_url($uri); |
| 509 | 509 | if (!isset($parts['scheme'])) { |
| 510 | - if (!in_array($uri[0], [ '/', '#', '?' ])) { |
|
| 510 | + if (!in_array($uri[0], ['/', '#', '?'])) { |
|
| 511 | 511 | $path = isset($parts['path']) ? $parts['path'] : ''; |
| 512 | 512 | $query = isset($parts['query']) ? $parts['query'] : ''; |
| 513 | 513 | $hash = isset($parts['fragment']) ? $parts['fragment'] : ''; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | continue; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $segments[$key] = (string)$value; |
|
| 89 | + $segments[$key] = (string) $value; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | return $segments; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | final public function documentTitle() |
| 130 | 130 | { |
| 131 | 131 | $parts = $this->documentTitleParts(); |
| 132 | - if (array_diff_key([ 'title' => true, 'site' => true ], $parts)) { |
|
| 132 | + if (array_diff_key(['title' => true, 'site' => true], $parts)) { |
|
| 133 | 133 | throw new InvalidArgumentException( |
| 134 | 134 | 'The document title parts requires at least a "title" and a "site"' |
| 135 | 135 | ); |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | protected function formatAlternateTranslation($context, array $localeStruct) |
| 177 | 177 | { |
| 178 | 178 | return [ |
| 179 | - 'id' => ($context['id']) ? : $this->templateName(), |
|
| 180 | - 'title' => ((string)$context['title']) ? : $this->title(), |
|
| 179 | + 'id' => ($context['id']) ?: $this->templateName(), |
|
| 180 | + 'title' => ((string) $context['title']) ?: $this->title(), |
|
| 181 | 181 | 'url' => $this->formatAlternateTranslationUrl($context, $localeStruct), |
| 182 | 182 | 'hreflang' => $localeStruct['code'], |
| 183 | 183 | 'locale' => $localeStruct['locale'], |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $isRoutable = ($context instanceof RoutableInterface && $context->isActiveRoute()); |
| 203 | 203 | $langCode = $localeStruct['code']; |
| 204 | - $path = ($isRoutable ? $context->url($langCode) : ($this->currentUrl() ? : $langCode)); |
|
| 204 | + $path = ($isRoutable ? $context->url($langCode) : ($this->currentUrl() ?: $langCode)); |
|
| 205 | 205 | |
| 206 | 206 | if ($path instanceof UriInterface) { |
| 207 | 207 | $path = $path->getPath(); |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $now = new DateTime(); |
| 54 | 54 | $loader = $this->all(); |
| 55 | - $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]) |
|
| 56 | - ->addFilter('expiryDate', $now->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]); |
|
| 55 | + $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), ['operator' => '<=']) |
|
| 56 | + ->addFilter('expiryDate', $now->format('Y-m-d H:i:s'), ['operator' => '>=']); |
|
| 57 | 57 | |
| 58 | 58 | return $loader; |
| 59 | 59 | } |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $now = new DateTime(); |
| 67 | 67 | $loader = $this->all(); |
| 68 | - $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]) |
|
| 69 | - ->addFilter('expiryDate', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]); |
|
| 68 | + $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), ['operator' => '<=']) |
|
| 69 | + ->addFilter('expiryDate', $now->format('Y-m-d H:i:s'), ['operator' => '<=']); |
|
| 70 | 70 | |
| 71 | 71 | return $loader; |
| 72 | 72 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $now = new DateTime(); |
| 58 | 58 | $loader = $this->all(); |
| 59 | - $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), [ 'operator' => '<=' ]) |
|
| 59 | + $loader->addFilter('publishDate', $now->format('Y-m-d H:i:s'), ['operator' => '<=']) |
|
| 60 | 60 | ->addOrder('start_date', 'asc'); |
| 61 | 61 | |
| 62 | 62 | return $loader; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | $date = $this->parseAsDate($date); |
| 99 | 99 | $loader = $this->published(); |
| 100 | - $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '>=' ]); |
|
| 100 | + $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), ['operator' => '>=']); |
|
| 101 | 101 | |
| 102 | 102 | return $loader; |
| 103 | 103 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $date = $this->parseAsDate($date); |
| 115 | 115 | $loader = $this->published(); |
| 116 | - $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), [ 'operator' => '<' ]); |
|
| 116 | + $loader->addFilter('end_date', $date->format('Y-m-d H:i:s'), ['operator' => '<']); |
|
| 117 | 117 | |
| 118 | 118 | return $loader; |
| 119 | 119 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (isset($contextObject['active'])) { |
| 135 | - return (bool)$contextObject['active']; |
|
| 135 | + return (bool) $contextObject['active']; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return true; |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | if ($route->getRouteOptionsIdent()) { |
| 453 | 453 | $loader->addFilter('route_options_ident', $route->getRouteOptionsIdent()); |
| 454 | 454 | } else { |
| 455 | - $loader->addFilter('route_options_ident', '', [ 'operator' => 'IS NULL' ]); |
|
| 455 | + $loader->addFilter('route_options_ident', '', ['operator' => 'IS NULL']); |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | return $loader->load()->first(); |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | if (isset($available[$code])) { |
| 524 | 524 | $locale = $available[$code]; |
| 525 | 525 | if (isset($locale['locales'])) { |
| 526 | - $choices = (array)$locale['locales']; |
|
| 526 | + $choices = (array) $locale['locales']; |
|
| 527 | 527 | array_push($locales, ...$choices); |
| 528 | 528 | } elseif (isset($locale['locale'])) { |
| 529 | 529 | array_push($locales, $locale['locale']); |
@@ -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 (!isset($this['name']) || !(string)$this['name'][$locale]) { |
|
| 85 | + if (!isset($this['name']) || !(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 | ]) |