From 8b743b3f00b896d3d077f9a9d7b59c505657b071 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 2 May 2024 10:27:38 +0200 Subject: [PATCH] drop support for PHP < 7.4, fix PHP 8.4 compatibility --- .github/workflows/ci.yml | 6 +++--- composer.json | 2 +- src/Css/Property/Processor.php | 4 ++-- src/Css/Property/Property.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89fbce0..5db6f31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,14 +24,14 @@ jobs: strategy: fail-fast: false matrix: - php: [ '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] operating-system: [ ubuntu-latest ] composer_flags: [ '' ] include: - - php: '5.5' + - php: '7.4' composer_flags: '--prefer-lowest' operating-system: ubuntu-latest - - php: '7.0' + - php: '8.0' composer_flags: '--prefer-lowest' operating-system: ubuntu-latest - php: '8.1' diff --git a/composer.json b/composer.json index 055ba41..8e0db4d 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "^5.5 || ^7.0 || ^8.0", + "php": "^7.4 || ^8.0", "ext-dom": "*", "ext-libxml": "*", "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" diff --git a/src/Css/Property/Processor.php b/src/Css/Property/Processor.php index 3b01861..03903d7 100644 --- a/src/Css/Property/Processor.php +++ b/src/Css/Property/Processor.php @@ -66,7 +66,7 @@ private function cleanup($string) * * @return Property|null */ - public function convertToObject($property, Specificity $specificity = null) + public function convertToObject($property, ?Specificity $specificity = null) { if (strpos($property, ':') === false) { return null; @@ -91,7 +91,7 @@ public function convertToObject($property, Specificity $specificity = null) * * @return Property[] */ - public function convertArrayToObjects(array $properties, Specificity $specificity = null) + public function convertArrayToObjects(array $properties, ?Specificity $specificity = null) { $objects = array(); diff --git a/src/Css/Property/Property.php b/src/Css/Property/Property.php index c8970cf..8e09c76 100644 --- a/src/Css/Property/Property.php +++ b/src/Css/Property/Property.php @@ -27,7 +27,7 @@ final class Property * @param string $value * @param Specificity|null $specificity */ - public function __construct($name, $value, Specificity $specificity = null) + public function __construct($name, $value, ?Specificity $specificity = null) { $this->name = $name; $this->value = $value;