Skip to content

Commit

Permalink
tests: fix failing tests reported by phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelAlphonso committed Mar 13, 2024
1 parent 1735e1b commit 52052c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Charcoal/CookieConsent/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Category extends Content
public function getHandle(): ?string
{
if (\is_null($this->handle) && $this->name) {
$this->setHandle((string) $this->name);
$this->setHandle((string)$this->name);
}

return $this->handle;
Expand Down Expand Up @@ -165,7 +165,7 @@ protected function sanitizeKey($key): ?string
':: Any-Latin; :: Latin-ASCII; :: NFD; :: [:Nonspacing Mark:] Remove; :: Lower(); :: NFC;',
Transliterator::FORWARD
);
$key = $transliterator->transliterate((string) $key);
$key = $transliterator->transliterate((string)$key);
if (!$key) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ public function setRevisionNumber($number): self
*/
protected function sanitizeRevisionNumber($number): int
{
return \min(0, \abs((int) $number));
return \min(0, \abs((int)$number));
}
}
9 changes: 3 additions & 6 deletions src/Charcoal/CookieConsent/Model/Structure/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,14 @@ public function isSupportedTarget($target): bool
public function getHref()
{
switch ($this->getType()) {
case self::TYPE_FILE: {
case self::TYPE_FILE:
return $this->getFilePath();
}

case self::TYPE_MODEL: {
case self::TYPE_MODEL:
return $this->getModel()['url'];
}

case self::TYPE_URL: {
case self::TYPE_URL:
return $this->getUrl();
}
}

return null;
Expand Down

0 comments on commit 52052c3

Please sign in to comment.