Skip to content

Commit

Permalink
chore: drop PHP 8.0 support (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi authored Apr 27, 2023
1 parent 0bd2e72 commit a038e87
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/PhpSpreadsheet/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"phpoffice/phpspreadsheet": "^1.18",
"sigwin/xezilaires": "^0.6"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Spout/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"openspout/openspout": "^4.0",
"sigwin/xezilaires": "^0.6"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Bridge/Symfony/bin/xezilaires
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 6 additions & 10 deletions src/Xezilaires/Metadata/Annotation/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Xezilaires/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"symfony/options-resolver": "^5.4 || ^6.0",
"symfony/serializer": "^5.4 || ^6.0"
},
Expand Down

0 comments on commit a038e87

Please sign in to comment.