diff --git a/.github/workflows/4.8.x-test.yml b/.github/workflows/4.8.x-test.yml index 6ccd106e..9c72d4d7 100644 --- a/.github/workflows/4.8.x-test.yml +++ b/.github/workflows/4.8.x-test.yml @@ -4,14 +4,14 @@ name: 4.8.x on PHP 8.x on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - + push: branches: ['4.8.x'] paths-ignore: - '*.md' - '.github/**' - 'scripts/**' - + pull_request: branches: ['4.8.x'] paths-ignore: @@ -24,12 +24,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - php-version: [8.0, 8.1, 8.2, 8.3] + php-version: [8.0, 8.1, 8.2, 8.3, 8.4] os: ['ubuntu-latest'] - include: - - os: 'ubuntu-latest' - phpunit-version: '9.6.10' - composer-version: 'latest' + composer-version: ['latest'] + phpunit-version: ['^9.6.18'] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/composer.json b/composer.json index e789b8c2..63e65536 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^v3.35.1", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^9.6.18", "squizlabs/php_codesniffer": "^3.7", "phpbench/phpbench": "^1.2", "phpstan/phpstan": "^1.10" diff --git a/src/Cache/CacheException.php b/src/Cache/CacheException.php index 7b65809d..e23bcd8a 100644 --- a/src/Cache/CacheException.php +++ b/src/Cache/CacheException.php @@ -6,7 +6,7 @@ class CacheException extends \Exception { - public function __construct($message, $code = 0, \Throwable $previous = null) + public function __construct($message, $code = 0, ?\Throwable $previous = null) { // some code diff --git a/src/MobileDetect.php b/src/MobileDetect.php index 243e06a0..7ae308b5 100644 --- a/src/MobileDetect.php +++ b/src/MobileDetect.php @@ -1028,11 +1028,11 @@ class MobileDetect * Construct an instance of this class. */ public function __construct( - Cache $cache = null, + ?Cache $cache = null, array $config = [], ) { // If no custom cache provided then use our own. - $this->cache = $cache == null ? new Cache() : $cache; + $this->cache = $cache ?? new Cache(); // Override config from user. $this->config = array_merge($this->config, $config);