Skip to content

Commit 42acc7e

Browse files
committed
chore: make compatible with PHP 8.4
Fixes deprecations introduced in PHP 8.4. See https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated
1 parent 7e16d0f commit 42acc7e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
php-versions: [ '7.3', '7.4', '8.0', '8.1' ]
14+
php-versions: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
1515

1616
name: PHP ${{ matrix.php-versions }} Test
1717

src/Categories.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Categories
2929
* @param null|string $dataFilePath
3030
* @throws Exception
3131
*/
32-
public function __construct(string $encoding='utf8', string $dataFilePath = null)
32+
public function __construct(string $encoding='utf8', ?string $dataFilePath = null)
3333
{
3434
if (is_null($dataFilePath)){
3535
$dataFilePath = __DIR__ . DIRECTORY_SEPARATOR . 'categories.json';
@@ -137,4 +137,4 @@ public function uniqueAliases(string $string) : array
137137
}
138138
return $return;
139139
}
140-
}
140+
}

src/Confusable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Confusable
3434
* @param null|string $dataFilePath
3535
* @throws \Exception
3636
*/
37-
public function __construct(Categories $categories, string $encoding='utf8', string $dataFilePath = null)
37+
public function __construct(Categories $categories, string $encoding='utf8', ?string $dataFilePath = null)
3838
{
3939
if (is_null($dataFilePath)){
4040
$dataFilePath = __DIR__ . DIRECTORY_SEPARATOR . 'confusables.json';
@@ -217,4 +217,4 @@ public function isDangerous(string $string, array $preferredAliases = []) : bool
217217
return $this->isMixedScript($string) === true && $this->isConfusable($string, false, $preferredAliases) !== false;
218218
}
219219

220-
}
220+
}

0 commit comments

Comments
 (0)