From 52052c3de3674f16fe2c7a4802ace185ec8a8e47 Mon Sep 17 00:00:00 2001 From: Joel Alphonso Date: Wed, 13 Mar 2024 11:33:17 -0400 Subject: [PATCH] tests: fix failing tests reported by phpcs --- src/Charcoal/CookieConsent/Model/Category.php | 4 ++-- .../CookieConsent/Model/Structure/ConsentRevision.php | 2 +- src/Charcoal/CookieConsent/Model/Structure/Link.php | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Charcoal/CookieConsent/Model/Category.php b/src/Charcoal/CookieConsent/Model/Category.php index e129776..206b205 100644 --- a/src/Charcoal/CookieConsent/Model/Category.php +++ b/src/Charcoal/CookieConsent/Model/Category.php @@ -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; @@ -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; } diff --git a/src/Charcoal/CookieConsent/Model/Structure/ConsentRevision.php b/src/Charcoal/CookieConsent/Model/Structure/ConsentRevision.php index 53d8762..c40128c 100644 --- a/src/Charcoal/CookieConsent/Model/Structure/ConsentRevision.php +++ b/src/Charcoal/CookieConsent/Model/Structure/ConsentRevision.php @@ -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)); } } diff --git a/src/Charcoal/CookieConsent/Model/Structure/Link.php b/src/Charcoal/CookieConsent/Model/Structure/Link.php index b119019..9d3a236 100644 --- a/src/Charcoal/CookieConsent/Model/Structure/Link.php +++ b/src/Charcoal/CookieConsent/Model/Structure/Link.php @@ -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;