Skip to content

Commit

Permalink
Remove redundant PHP version check for enums
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koriym committed Oct 22, 2024
1 parent 9d90024 commit ea76d55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/ClassParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/HttpRequestCurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
) {
}

/** @inheritdoc */
/** @inheritDoc */
public function request(string $method, string $uri, array $query): array
{
$body = http_build_query($query);
Expand Down

0 comments on commit ea76d55

Please sign in to comment.