diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d286d28..d79bc54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,4 +30,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.1', '8.2', '8.3'] + ['8.1', '8.2', '8.3', '8.4'] diff --git a/CHANGELOG.md b/CHANGELOG.md index 64fa5db..f32e4c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Change Log ## 0.1.3 Under development - Enh #87: Refactor `SemverUtil::class` stability normalization logic (@terabytesoftw) +- Bug #104: Add support for PHP 8.4 (@terabytesoftw) ## 0.1.2 June 10, 2024 diff --git a/composer.json b/composer.json index be34835..1ee332c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "php-forge/support": "^0.1", "phpunit/phpunit": "^10.5", "symplify/easy-coding-standard": "^12.1", - "vimeo/psalm": "^5.20" + "vimeo/psalm": "^5.26.1|^6.4.1" }, "config": { "preferred-install": { diff --git a/src/Asset/AssetManagerFinder.php b/src/Asset/AssetManagerFinder.php index 251f048..6f0c9dc 100644 --- a/src/Asset/AssetManagerFinder.php +++ b/src/Asset/AssetManagerFinder.php @@ -52,7 +52,7 @@ public function addManager(AssetManagerInterface $manager): void * @throws RuntimeException When the asset manager does not exist * @throws RuntimeException When the asset manager is not found */ - public function findManager(string $manager = null): AssetManagerInterface + public function findManager(string|null $manager = null): AssetManagerInterface { if (null !== $manager) { if (isset($this->managers[$manager])) { diff --git a/src/Config/ConfigBuilder.php b/src/Config/ConfigBuilder.php index abcbb00..b3a6903 100644 --- a/src/Config/ConfigBuilder.php +++ b/src/Config/ConfigBuilder.php @@ -31,7 +31,7 @@ abstract class ConfigBuilder * @param array $defaults The default values. * @param IOInterface|null $io The composer input/output. */ - public static function build(Composer $composer, array $defaults = [], IOInterface $io = null): Config + public static function build(Composer $composer, array $defaults = [], IOInterface|null $io = null): Config { $config = self::getConfigBase($composer, $io); @@ -44,7 +44,7 @@ public static function build(Composer $composer, array $defaults = [], IOInterfa * @param Composer $composer The composer. * @param IOInterface|null $io The composer input/output. */ - private static function getConfigBase(Composer $composer, IOInterface $io = null): array + private static function getConfigBase(Composer $composer, IOInterface|null $io = null): array { $globalPackageConfig = self::getGlobalConfig($composer, 'composer', $io); $globalConfig = self::getGlobalConfig($composer, 'config', $io); @@ -63,7 +63,7 @@ private static function getConfigBase(Composer $composer, IOInterface $io = null * @param string $filename The filename. * @param IOInterface|null $io The composer input/output. */ - private static function getGlobalConfig(Composer $composer, string $filename, IOInterface $io = null): array + private static function getGlobalConfig(Composer $composer, string $filename, IOInterface|null $io = null): array { $home = self::getComposerHome($composer); $file = new JsonFile($home . '/' . $filename . '.json'); diff --git a/src/Converter/SemverConverter.php b/src/Converter/SemverConverter.php index 2b59c30..cbb70bc 100644 --- a/src/Converter/SemverConverter.php +++ b/src/Converter/SemverConverter.php @@ -20,7 +20,7 @@ */ final class SemverConverter implements VersionConverterInterface { - public function convertVersion(string $version = null): string + public function convertVersion(string|null $version = null): string { if (\in_array($version, [null, '', 'latest'], true)) { return ('latest' === $version ? 'default || ' : '') . '*'; diff --git a/src/Converter/VersionConverterInterface.php b/src/Converter/VersionConverterInterface.php index 4c19bba..2577f48 100644 --- a/src/Converter/VersionConverterInterface.php +++ b/src/Converter/VersionConverterInterface.php @@ -27,5 +27,5 @@ interface VersionConverterInterface * * @return string The composer version */ - public function convertVersion(string $version = null): string; + public function convertVersion(string|null $version = null): string; } diff --git a/src/Fallback/AssetFallback.php b/src/Fallback/AssetFallback.php index 9103a41..591a2d4 100644 --- a/src/Fallback/AssetFallback.php +++ b/src/Fallback/AssetFallback.php @@ -31,7 +31,7 @@ public function __construct( protected IOInterface $io, protected Config $config, protected string $path, - Filesystem $fs = null + Filesystem|null $fs = null ) { $this->fs = $fs ?: new Filesystem(); } diff --git a/src/Fallback/ComposerFallback.php b/src/Fallback/ComposerFallback.php index 8412f11..aa4a654 100644 --- a/src/Fallback/ComposerFallback.php +++ b/src/Fallback/ComposerFallback.php @@ -48,7 +48,7 @@ public function __construct( protected IOInterface $io, protected Config $config, protected InputInterface $input, - Filesystem $fs = null, + Filesystem|null $fs = null, protected Installer|null $installer = null ) { $this->fs = $fs ?: new Filesystem();