From ea76d55d27b89cd84955bc23f89c9e87a4b184fa Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 23 Oct 2024 08:12:26 +0900 Subject: [PATCH] Remove redundant PHP version check for enums This update simplifies the code by removing the PHP version check before calling the isEnum method. Since the project now requires a PHP version that supports enums, the conditional check is unnecessary. This change enhances readability and maintainability of the code. --- src/ClassParam.php | 4 +--- src/HttpRequestCurl.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ClassParam.php b/src/ClassParam.php index fbf55942..0da2fdbb 100644 --- a/src/ClassParam.php +++ b/src/ClassParam.php @@ -24,8 +24,6 @@ use function preg_replace; use function strtolower; -use const PHP_VERSION_ID; - final class ClassParam implements ParamInterface { private readonly string $type; @@ -64,7 +62,7 @@ public function __invoke(string $varName, array $query, InjectorInterface $injec assert(class_exists($this->type)); $refClass = (new ReflectionClass($this->type)); - if (PHP_VERSION_ID >= 80100 && $refClass->isEnum()) { + if ($refClass->isEnum()) { return $this->enum($this->type, $props, $varName); } diff --git a/src/HttpRequestCurl.php b/src/HttpRequestCurl.php index f4eabda2..90dbb9eb 100644 --- a/src/HttpRequestCurl.php +++ b/src/HttpRequestCurl.php @@ -44,7 +44,7 @@ public function __construct( ) { } - /** @inheritdoc */ + /** @inheritDoc */ public function request(string $method, string $uri, array $query): array { $body = http_build_query($query);