Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- name: Run PHPStan
run: vendor/bin/phpstan analyse
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
}
],
"require": {
"php": "^8.1"
"php": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"symfony/var-dumper": "^6.3",
"symfony/var-dumper": "^5.4",
"phpstan/phpstan": "^1.10"
},
"autoload": {
Expand Down
11 changes: 8 additions & 3 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -30,7 +35,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();

Expand Down