Skip to content

Commit

Permalink
PHP 8.4 - implicit nulls are deprecated (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte authored Aug 12, 2024
1 parent 9deba9f commit 8f54bd3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/4.8.x-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
},
"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"
"phpstan/phpstan": "^1.12.x-dev"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/CacheException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/MobileDetect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8f54bd3

Please sign in to comment.