From a038e878e6f2f8b4887902e26e1329c765d37564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Karlovi=C4=87?= Date: Thu, 27 Apr 2023 18:43:05 +0200 Subject: [PATCH] chore: drop PHP 8.0 support (#175) --- composer.json | 2 +- src/Bridge/PhpSpreadsheet/composer.json | 2 +- src/Bridge/Spout/composer.json | 2 +- src/Bridge/Symfony/bin/xezilaires | 4 ++-- src/Bridge/Symfony/composer.json | 2 +- .../Metadata/Annotation/AnnotationDriver.php | 16 ++++++---------- src/Xezilaires/composer.json | 2 +- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index 8212472..888d32a 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "ext-json": "*", "symfony/options-resolver": "^5.4 || ^6.0", "symfony/serializer": "^5.4 || ^6.0" diff --git a/src/Bridge/PhpSpreadsheet/composer.json b/src/Bridge/PhpSpreadsheet/composer.json index d6db6bc..6542038 100644 --- a/src/Bridge/PhpSpreadsheet/composer.json +++ b/src/Bridge/PhpSpreadsheet/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "phpoffice/phpspreadsheet": "^1.18", "sigwin/xezilaires": "^0.6" }, diff --git a/src/Bridge/Spout/composer.json b/src/Bridge/Spout/composer.json index 4ab5325..c727018 100644 --- a/src/Bridge/Spout/composer.json +++ b/src/Bridge/Spout/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "openspout/openspout": "^4.0", "sigwin/xezilaires": "^0.6" }, diff --git a/src/Bridge/Symfony/bin/xezilaires b/src/Bridge/Symfony/bin/xezilaires index 4dd229b..eec0a34 100755 --- a/src/Bridge/Symfony/bin/xezilaires +++ b/src/Bridge/Symfony/bin/xezilaires @@ -6,8 +6,8 @@ use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Xezilaires\Bridge\Symfony\AppKernel; use Xezilaires\Bridge\Symfony\Console\Application; -if (version_compare('8.0.0', PHP_VERSION, '>')) { - fwrite(STDERR, 'Xezilaires requires PHP 8.0+'.PHP_EOL); +if (version_compare('8.1.0', PHP_VERSION, '>')) { + fwrite(STDERR, 'Xezilaires requires PHP 8.1+'.PHP_EOL); exit(1); } diff --git a/src/Bridge/Symfony/composer.json b/src/Bridge/Symfony/composer.json index 32c66fe..4f1232e 100644 --- a/src/Bridge/Symfony/composer.json +++ b/src/Bridge/Symfony/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "sigwin/xezilaires": "^0.6", "symfony/console": "^5.4 || ^6.0", "symfony/framework-bundle": "^5.4 || ^6.0", diff --git a/src/Xezilaires/Metadata/Annotation/AnnotationDriver.php b/src/Xezilaires/Metadata/Annotation/AnnotationDriver.php index d771f88..d8dff3f 100644 --- a/src/Xezilaires/Metadata/Annotation/AnnotationDriver.php +++ b/src/Xezilaires/Metadata/Annotation/AnnotationDriver.php @@ -143,11 +143,9 @@ private function createReference(Annotation\Reference $annotation) */ private function getClassAnnotationOrAttribute(\ReflectionClass $reflection, string $name): array { - if (\PHP_VERSION_ID >= 80000) { - $attribute = current($reflection->getAttributes($name)); - if ($attribute !== false) { - return $attribute->getArguments(); - } + $attribute = current($reflection->getAttributes($name)); + if ($attribute !== false) { + return $attribute->getArguments(); } return (array) $this->reader->getClassAnnotation($reflection, $name); @@ -162,11 +160,9 @@ private function getClassAnnotationOrAttribute(\ReflectionClass $reflection, str */ private function getPropertyAnnotationOrAttribute(\ReflectionProperty $reflection, string $name) { - if (\PHP_VERSION_ID >= 80000) { - $attribute = current($reflection->getAttributes($name)); - if ($attribute !== false) { - return $attribute->newInstance(); - } + $attribute = current($reflection->getAttributes($name)); + if ($attribute !== false) { + return $attribute->newInstance(); } return $this->reader->getPropertyAnnotation($reflection, $name); diff --git a/src/Xezilaires/composer.json b/src/Xezilaires/composer.json index c3b7892..5d2170a 100644 --- a/src/Xezilaires/composer.json +++ b/src/Xezilaires/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "symfony/options-resolver": "^5.4 || ^6.0", "symfony/serializer": "^5.4 || ^6.0" },