Skip to content

Commit 9072a7c

Browse files
Update nullable type hints for method parameters and properties for PHP 8.4 deprecated rfc nullable. (#104)
1 parent 27ec552 commit 9072a7c

File tree

9 files changed

+11
-10
lines changed

9 files changed

+11
-10
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
os: >-
3131
['ubuntu-latest', 'windows-latest']
3232
php: >-
33-
['8.1', '8.2', '8.3']
33+
['8.1', '8.2', '8.3', '8.4']

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Log
44
## 0.1.3 Under development
55

66
- Enh #87: Refactor `SemverUtil::class` stability normalization logic (@terabytesoftw)
7+
- Bug #104: Add support for PHP 8.4 (@terabytesoftw)
78

89
## 0.1.2 June 10, 2024
910

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"php-forge/support": "^0.1",
2626
"phpunit/phpunit": "^10.5",
2727
"symplify/easy-coding-standard": "^12.1",
28-
"vimeo/psalm": "^5.20"
28+
"vimeo/psalm": "^5.26.1|^6.4.1"
2929
},
3030
"config": {
3131
"preferred-install": {

src/Asset/AssetManagerFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function addManager(AssetManagerInterface $manager): void
5252
* @throws RuntimeException When the asset manager does not exist
5353
* @throws RuntimeException When the asset manager is not found
5454
*/
55-
public function findManager(string $manager = null): AssetManagerInterface
55+
public function findManager(string|null $manager = null): AssetManagerInterface
5656
{
5757
if (null !== $manager) {
5858
if (isset($this->managers[$manager])) {

src/Config/ConfigBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ abstract class ConfigBuilder
3131
* @param array $defaults The default values.
3232
* @param IOInterface|null $io The composer input/output.
3333
*/
34-
public static function build(Composer $composer, array $defaults = [], IOInterface $io = null): Config
34+
public static function build(Composer $composer, array $defaults = [], IOInterface|null $io = null): Config
3535
{
3636
$config = self::getConfigBase($composer, $io);
3737

@@ -44,7 +44,7 @@ public static function build(Composer $composer, array $defaults = [], IOInterfa
4444
* @param Composer $composer The composer.
4545
* @param IOInterface|null $io The composer input/output.
4646
*/
47-
private static function getConfigBase(Composer $composer, IOInterface $io = null): array
47+
private static function getConfigBase(Composer $composer, IOInterface|null $io = null): array
4848
{
4949
$globalPackageConfig = self::getGlobalConfig($composer, 'composer', $io);
5050
$globalConfig = self::getGlobalConfig($composer, 'config', $io);
@@ -63,7 +63,7 @@ private static function getConfigBase(Composer $composer, IOInterface $io = null
6363
* @param string $filename The filename.
6464
* @param IOInterface|null $io The composer input/output.
6565
*/
66-
private static function getGlobalConfig(Composer $composer, string $filename, IOInterface $io = null): array
66+
private static function getGlobalConfig(Composer $composer, string $filename, IOInterface|null $io = null): array
6767
{
6868
$home = self::getComposerHome($composer);
6969
$file = new JsonFile($home . '/' . $filename . '.json');

src/Converter/SemverConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
final class SemverConverter implements VersionConverterInterface
2222
{
23-
public function convertVersion(string $version = null): string
23+
public function convertVersion(string|null $version = null): string
2424
{
2525
if (\in_array($version, [null, '', 'latest'], true)) {
2626
return ('latest' === $version ? 'default || ' : '') . '*';

src/Converter/VersionConverterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ interface VersionConverterInterface
2727
*
2828
* @return string The composer version
2929
*/
30-
public function convertVersion(string $version = null): string;
30+
public function convertVersion(string|null $version = null): string;
3131
}

src/Fallback/AssetFallback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131
protected IOInterface $io,
3232
protected Config $config,
3333
protected string $path,
34-
Filesystem $fs = null
34+
Filesystem|null $fs = null
3535
) {
3636
$this->fs = $fs ?: new Filesystem();
3737
}

src/Fallback/ComposerFallback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(
4848
protected IOInterface $io,
4949
protected Config $config,
5050
protected InputInterface $input,
51-
Filesystem $fs = null,
51+
Filesystem|null $fs = null,
5252
protected Installer|null $installer = null
5353
) {
5454
$this->fs = $fs ?: new Filesystem();

0 commit comments

Comments
 (0)