From f7bf05a3fabd3ac5f7b859a8ca25d9e9bdfe826d Mon Sep 17 00:00:00 2001 From: DeGraciaMathieu Date: Sat, 6 Dec 2025 13:03:55 +0100 Subject: [PATCH 1/5] Updates PHP versions in CI workflow Updates the PHP versions used in the CI workflow to include PHP 8.0, 8.3, 8.4 and 8.5 for broader test coverage. Also updates the checkout action to v4 and provides more descriptive names for each step. --- .github/workflows/php.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4006475..0d0b19c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -8,26 +8,28 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: matrix: - php: [8.1, 8.2] + php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5] steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 - - name: Set PHP version - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer - - name: Install dependencies - run: composer update --prefer-dist --no-progress --no-suggest + - name: Install dependencies + run: composer update --prefer-dist --no-progress --no-interaction - - name: Execute PHPUnit - run: vendor/bin/phpunit + - name: Run PHPUnit + run: vendor/bin/phpunit - - name: Execute PHPStan analyse - run: vendor/bin/phpstan \ No newline at end of file + - name: Run PHPStan + run: vendor/bin/phpstan analyse From 550a4bdb13df53303070bda93f430d5a2e3ccc9c Mon Sep 17 00:00:00 2001 From: DeGraciaMathieu Date: Sat, 6 Dec 2025 13:05:51 +0100 Subject: [PATCH 2/5] Updates PHP requirement to be compatible with ^8.0 Updates the PHP version requirement in composer.json to be compatible with PHP versions greater than or equal to 8.0. This change ensures compatibility with a broader range of PHP versions, aligning with the testing matrix defined in the related GitHub Actions workflow. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bd76d89..53439f7 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^8.1" + "php": "^8.0" }, "require-dev": { "phpunit/phpunit": "^9.0", From 602ff9b7d1685bf5bd2bcfdf953ad0f84fc82b5a Mon Sep 17 00:00:00 2001 From: DeGraciaMathieu Date: Sat, 6 Dec 2025 13:07:23 +0100 Subject: [PATCH 3/5] Downgrades var-dumper package Downgrades symfony/var-dumper package to be compatible with PHP 7.4. The PHP version used in the tests is being updated, and this change ensures compatibility. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 53439f7..537f660 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "phpunit/phpunit": "^9.0", - "symfony/var-dumper": "^6.3", + "symfony/var-dumper": "^5.4", "phpstan/phpstan": "^1.10" }, "autoload": { From cbe630e0214588373d3ed3ebb629a2dd48c89a3e Mon Sep 17 00:00:00 2001 From: DeGraciaMathieu Date: Sat, 6 Dec 2025 13:09:04 +0100 Subject: [PATCH 4/5] Allows null value for driver name Updates the driver method to accept a null value for the name parameter. This change ensures that the method can gracefully handle cases where no specific driver name is provided, relying on the default driver configuration. --- src/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager.php b/src/Manager.php index 9e091ba..0012cc2 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -30,7 +30,7 @@ public function __call(string $method, array $parameters): mixed * @throws \DeGraciaMathieu\Manager\Exceptions\DriverOverwrittenException * @throws \DeGraciaMathieu\Manager\Exceptions\DriverResolutionException */ - public function driver(string $name = null): mixed + public function driver(?string $name = null): mixed { $name = $name ?: $this->getDefaultDriver(); From 220d087e4dd1a16badc7fceca87ec43f2ad686e6 Mon Sep 17 00:00:00 2001 From: DeGraciaMathieu Date: Sat, 6 Dec 2025 13:11:17 +0100 Subject: [PATCH 5/5] Makes Aggregator optional in constructor Allows for null to be passed as the Aggregator in the Manager constructor for better flexibility and retro-compatibility. Handles the case where a null Aggregator is passed by instantiating a new Aggregator instance within the constructor. --- src/Manager.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index 0012cc2..a88a23d 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -6,10 +6,15 @@ abstract class Manager { + protected Aggregator $aggregator; + public function __construct( protected bool $singleton = false, - protected Aggregator $aggregator = new Aggregator(), - ) {} + ?Aggregator $aggregator = null, + ) { + // php8.0 retro-compatibility + $this->aggregator = $aggregator ?? new Aggregator(); + } /** * Get the default driver name.