From 959a4ad2c8fbcf15b9c1f09948045428afc01818 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pudil?= <me@jiripudil.cz>
Date: Fri, 3 Jan 2025 16:46:39 +0100
Subject: [PATCH] chore: bump php requirement

---
 .gitlab-ci.yml                            | 2 +-
 composer.json                             | 2 +-
 src/Definition/Types/CheckedClassType.php | 2 +-
 src/Definition/Types/functions.php        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c96b8ac..320b260 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,5 @@
 default:
-  image: grifart/php8.0-with-all-modules-and-various-tools
+  image: grifart/php8.2-with-all-modules-and-various-tools
 
 stages:
   - build
diff --git a/composer.json b/composer.json
index 927b1ae..7601556 100644
--- a/composer.json
+++ b/composer.json
@@ -24,7 +24,7 @@
 		"phpstan": "phpstan analyze --ansi --no-progress --no-interaction"
 	},
 	"require": {
-		"php": "^8.0",
+		"php": "^8.2",
 		"ext-tokenizer": "*",
 		"nette/finder": "^2.5||^3.0",
 		"nette/php-generator": "^4.0.1",
diff --git a/src/Definition/Types/CheckedClassType.php b/src/Definition/Types/CheckedClassType.php
index 043cd88..0ac8f0c 100644
--- a/src/Definition/Types/CheckedClassType.php
+++ b/src/Definition/Types/CheckedClassType.php
@@ -16,7 +16,7 @@ final class CheckedClassType implements Type, ClassType
 
 	public function __construct(string $typeName)
 	{
-		if ( ! \class_exists($typeName) && ! \interface_exists($typeName) && (\PHP_VERSION_ID >= 80100 && ! \enum_exists($typeName))) {
+		if ( ! \class_exists($typeName) && ! \interface_exists($typeName) && ! \enum_exists($typeName)) {
 			throw new \InvalidArgumentException(\sprintf(
 				'Class type %s was not found. Make sure your autoloading setup is correct.',
 				$typeName
diff --git a/src/Definition/Types/functions.php b/src/Definition/Types/functions.php
index aa8c638..5ee2598 100644
--- a/src/Definition/Types/functions.php
+++ b/src/Definition/Types/functions.php
@@ -23,7 +23,7 @@ function resolve(Type|ClassDefinition|string $type): Type {
 		return SimpleType::$type(); // @phpstan-ignore return.type
 	}
 
-	if (\class_exists($type) || \interface_exists($type) || (\PHP_VERSION_ID >= 80100 && \enum_exists($type))) {
+	if (\class_exists($type) || \interface_exists($type) || \enum_exists($type)) {
 		return new CheckedClassType($type);
 	}
 
-- 
GitLab