From 698d3de2eea82519c2acc9855718c4e87aaa2a9a 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.2, fix PHP 8.4 compatibility --- .github/workflows/ci.yml | 6 +++--- composer.json | 4 ++-- src/Css/Property/Processor.php | 4 ++-- src/Css/Property/Property.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89fbce0..2aef289 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.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] operating-system: [ ubuntu-latest ] composer_flags: [ '' ] include: - - php: '5.5' + - php: '7.2' 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..59e4ef2 100644 --- a/composer.json +++ b/composer.json @@ -12,13 +12,13 @@ } ], "require": { - "php": "^5.5 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "ext-dom": "*", "ext-libxml": "*", "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" + "phpunit/phpunit": "^8.5.21 || ^9.5.10" }, "autoload": { "psr-4": { 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;