diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 3c70a6f2..ee6d326b 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2'] + php-version: ['8.3'] steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6d78407a..367ef80e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2'] + php-version: ['8.3', '8.4'] steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 @@ -45,7 +45,7 @@ jobs: key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php-${{ matrix.php-version }}- - - run: make composer.lock pkg-install tools/psalm/vendor/bin/psalm tools/phpunit/vendor/bin/phpunit + - run: make composer.lock pkg-install tools/psalm/vendor/bin/psalm tools/phpunit/bin/run - name: Get changed PHP files if: github.ref != 'refs/heads/main' id: changed-php-files diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index eda07044..dcc1757e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2', '8.3'] + php-version: ['8.3', '8.4'] steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 96b650a6..7978c8ec 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -8,6 +8,7 @@ $finder = Finder::create() ->in(__DIR__) + ->in(__DIR__ . '/tools/chorale/src/') ->exclude('build') ->exclude('docs') ->exclude('tools') @@ -21,8 +22,8 @@ ->setRules([ // Rule sets '@PER-CS' => true, - '@PHP80Migration:risky' => true, - '@PHP82Migration' => true, + '@PHP82Migration:risky' => true, + '@PHP83Migration' => true, '@PHPUnit100Migration:risky' => true, // Rules diff --git a/Makefile b/Makefile index 29c6a146..3321ebb3 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ CHURN = tools/churn/vendor/bin/churn INFECTION = tools/infection/vendor/bin/infection PHP_CS_FIXER = tools/php-cs-fixer/vendor/bin/php-cs-fixer PHPACTOR = tools/phpactor/vendor/bin/phpactor -PHPUNIT = tools/phpunit/vendor/bin/phpunit +PHPUNIT = tools/phpunit/bin/run PSALM = tools/psalm/vendor/bin/psalm RECTOR = tools/rector/vendor/bin/rector # end: Tools diff --git a/composer.json b/composer.json index 2b06555c..7d88e48f 100644 --- a/composer.json +++ b/composer.json @@ -230,7 +230,6 @@ } }, "require-dev": { - "phpunit/phpunit": "^10.4", "symfony/http-foundation": "^5 || ^6 || ^7", "symfony/messenger": "^5 || ^6 || ^7", "symfony/serializer": "^5 || ^6 || ^7" @@ -246,4 +245,4 @@ "@php -r \"if(file_exists('./.git')&&file_exists('./build/hooks/pre-commit')){copy('./build/hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0755);}\"" ] } -} \ No newline at end of file +} diff --git a/psalm.xml b/psalm.xml index a871e301..0e0d3746 100644 --- a/psalm.xml +++ b/psalm.xml @@ -11,11 +11,19 @@ findUnusedVariablesAndParams="true" findUnusedBaselineEntry="false" findUnusedCode="true" + phpVersion="8.3" autoloader="vendor/autoload.php" > + + + + + + + @@ -23,6 +31,8 @@ + + @@ -32,7 +42,25 @@ - - + + + + + + + + + + + + + + + + + + + + diff --git a/rector.php b/rector.php index 15402a28..3a96d3dc 100644 --- a/rector.php +++ b/rector.php @@ -9,16 +9,18 @@ ->withCache(__DIR__ . '/build/cache/rector') ->withPaths([ __DIR__ . '/src', + __DIR__ . '/tools/chorale', ]) ->withSkip([ __DIR__ . '/src/SonsOfPHP/*/vendor/*', __DIR__ . '/src/SonsOfPHP/*/*/vendor/*', __DIR__ . '/src/SonsOfPHP/*/*/*/vendor/*', __DIR__ . '/src/SonsOfPHP/*/*/*/*/vendor/*', + __DIR__ . '*/vendor/*', ]) // This should be the same version that is found in composer.json file ->withPhpSets( - php82: true, + php83: true, ) //->withAttributesSets( // phpunit: true, diff --git a/src/SonsOfPHP/Bard/Tests/Console/Command/AddCommandTest.php b/src/SonsOfPHP/Bard/Tests/Console/Command/AddCommandTest.php index 601a3d81..9b4258b4 100644 --- a/src/SonsOfPHP/Bard/Tests/Console/Command/AddCommandTest.php +++ b/src/SonsOfPHP/Bard/Tests/Console/Command/AddCommandTest.php @@ -41,14 +41,12 @@ #[UsesClass(AddPackageOperation::class)] final class AddCommandTest extends TestCase { - private Application $application; - private AddCommand $command; protected function setUp(): void { - $this->application = new Application(); - $this->command = $this->application->get('add'); + $application = new Application(); + $this->command = $application->get('add'); } public function testItsNameIsCorrect(): void diff --git a/src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php b/src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php index e3248ca4..4824e244 100644 --- a/src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php +++ b/src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php @@ -41,14 +41,12 @@ #[UsesClass(AddPackageOperation::class)] final class CopyCommandTest extends TestCase { - private Application $application; - private CopyCommand $command; protected function setUp(): void { - $this->application = new Application(); - $this->command = $this->application->get('copy'); + $application = new Application(); + $this->command = $application->get('copy'); } public function testItExecutesSuccessfully(): void diff --git a/src/SonsOfPHP/Bard/Tests/Console/Command/MergeCommandTest.php b/src/SonsOfPHP/Bard/Tests/Console/Command/MergeCommandTest.php index 5b17c721..d611467f 100644 --- a/src/SonsOfPHP/Bard/Tests/Console/Command/MergeCommandTest.php +++ b/src/SonsOfPHP/Bard/Tests/Console/Command/MergeCommandTest.php @@ -61,14 +61,12 @@ #[UsesClass(UpdateRequireDevSectionOperation::class)] final class MergeCommandTest extends TestCase { - private Application $application; - private MergeCommand $command; protected function setUp(): void { - $this->application = new Application(); - $this->command = $this->application->get('merge'); + $application = new Application(); + $this->command = $application->get('merge'); } public function testItExecutesSuccessfully(): void diff --git a/src/SonsOfPHP/Bard/Tests/Console/Command/PushCommandTest.php b/src/SonsOfPHP/Bard/Tests/Console/Command/PushCommandTest.php index 9c4f4769..2d15fdc5 100644 --- a/src/SonsOfPHP/Bard/Tests/Console/Command/PushCommandTest.php +++ b/src/SonsOfPHP/Bard/Tests/Console/Command/PushCommandTest.php @@ -41,14 +41,12 @@ #[UsesClass(AddPackageOperation::class)] final class PushCommandTest extends TestCase { - private Application $application; - private PushCommand $command; protected function setUp(): void { - $this->application = new Application(); - $this->command = $this->application->get('push'); + $application = new Application(); + $this->command = $application->get('push'); } public function testItExecutesSuccessfully(): void diff --git a/src/SonsOfPHP/Bard/Tests/Console/Command/ReleaseCommandTest.php b/src/SonsOfPHP/Bard/Tests/Console/Command/ReleaseCommandTest.php index 18f08418..946c442b 100644 --- a/src/SonsOfPHP/Bard/Tests/Console/Command/ReleaseCommandTest.php +++ b/src/SonsOfPHP/Bard/Tests/Console/Command/ReleaseCommandTest.php @@ -65,14 +65,12 @@ #[UsesClass(Version::class)] final class ReleaseCommandTest extends TestCase { - private Application $application; - private ReleaseCommand $command; protected function setUp(): void { - $this->application = new Application(); - $this->command = $this->application->get('release'); + $application = new Application(); + $this->command = $application->get('release'); } public function testItsNameIsCorrect(): void diff --git a/src/SonsOfPHP/Bard/Tests/Console/Command/SplitCommandTest.php b/src/SonsOfPHP/Bard/Tests/Console/Command/SplitCommandTest.php index 0f65882c..166f2800 100644 --- a/src/SonsOfPHP/Bard/Tests/Console/Command/SplitCommandTest.php +++ b/src/SonsOfPHP/Bard/Tests/Console/Command/SplitCommandTest.php @@ -39,14 +39,12 @@ #[UsesClass(JsonFile::class)] final class SplitCommandTest extends TestCase { - private Application $application; - private SplitCommand $command; protected function setUp(): void { - $this->application = new Application(); - $this->command = $this->application->get('split'); + $application = new Application(); + $this->command = $application->get('split'); } public function testItsNameIsCorrect(): void diff --git a/src/SonsOfPHP/Bard/composer.json b/src/SonsOfPHP/Bard/composer.json index e2a014a6..17eb55a2 100644 --- a/src/SonsOfPHP/Bard/composer.json +++ b/src/SonsOfPHP/Bard/composer.json @@ -12,7 +12,7 @@ "bin/bard" ], "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/event-dispatcher": "^0.3.x-dev", "sonsofphp/json": "^0.3.x-dev", "sonsofphp/logger": "^0.3.x-dev", @@ -71,4 +71,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bard/src/Console/Command/ReleaseCommand.php b/src/SonsOfPHP/Bard/src/Console/Command/ReleaseCommand.php index bd5930b7..7e222f6a 100644 --- a/src/SonsOfPHP/Bard/src/Console/Command/ReleaseCommand.php +++ b/src/SonsOfPHP/Bard/src/Console/Command/ReleaseCommand.php @@ -24,9 +24,9 @@ */ final class ReleaseCommand extends AbstractCommand { - private VersionInterface|null $currentVersion = null; + private ?VersionInterface $currentVersion = null; - private VersionInterface|null $releaseVersion = null; + private ?VersionInterface $releaseVersion = null; private bool $isDryRun = true; diff --git a/src/SonsOfPHP/Bridge/Aws/Filesystem/composer.json b/src/SonsOfPHP/Bridge/Aws/Filesystem/composer.json index d17e20a6..6479b95d 100644 --- a/src/SonsOfPHP/Bridge/Aws/Filesystem/composer.json +++ b/src/SonsOfPHP/Bridge/Aws/Filesystem/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/filesystem": "^0.3.x-dev", "aws/aws-sdk-php": "^3.0" }, @@ -55,4 +55,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json index 5a57913d..c7cebbb5 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/Collections/Pager/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "doctrine/collections": "^2", "sonsofphp/pager": "^0.3.x-dev" }, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json index ab9c3be8..48b7ba7c 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/DBAL/Pager/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "doctrine/dbal": "^3", "sonsofphp/pager": "^0.3.x-dev" }, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/EventSourcing/composer.json b/src/SonsOfPHP/Bridge/Doctrine/EventSourcing/composer.json index 06c8ae47..461e128e 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/EventSourcing/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/EventSourcing/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "doctrine/dbal": "^3", "sonsofphp/event-sourcing": "^0.3.x-dev" }, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json index fccc2dee..a3dc7127 100644 --- a/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json +++ b/src/SonsOfPHP/Bridge/Doctrine/ORM/Pager/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "doctrine/orm": "^2 || ^3", "sonsofphp/pager": "^0.3.x-dev" }, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/LiipImagine/Filesystem/composer.json b/src/SonsOfPHP/Bridge/LiipImagine/Filesystem/composer.json index 27699010..7a916ee5 100644 --- a/src/SonsOfPHP/Bridge/LiipImagine/Filesystem/composer.json +++ b/src/SonsOfPHP/Bridge/LiipImagine/Filesystem/composer.json @@ -38,7 +38,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/filesystem": "^0.3.x-dev", "liip/imagine-bundle": "^2.0" }, @@ -58,4 +58,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Symfony/Cqrs/composer.json b/src/SonsOfPHP/Bridge/Symfony/Cqrs/composer.json index 88e0ccbf..1e3e5c6f 100644 --- a/src/SonsOfPHP/Bridge/Symfony/Cqrs/composer.json +++ b/src/SonsOfPHP/Bridge/Symfony/Cqrs/composer.json @@ -41,7 +41,7 @@ }, "minimum-stability": "dev", "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/cqrs": "^0.3.x-dev", "symfony/options-resolver": "^6 || ^7" }, @@ -67,4 +67,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Symfony/EventSourcing/composer.json b/src/SonsOfPHP/Bridge/Symfony/EventSourcing/composer.json index 6376cd05..365ab7c5 100644 --- a/src/SonsOfPHP/Bridge/Symfony/EventSourcing/composer.json +++ b/src/SonsOfPHP/Bridge/Symfony/EventSourcing/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/event-sourcing": "^0.3.x-dev", "symfony/uid": "^5 || ^6 || ^7", "symfony/security-bundle": "^6 || ^7" @@ -59,4 +59,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bridge/Twig/Money/composer.json b/src/SonsOfPHP/Bridge/Twig/Money/composer.json index 373cff8e..733b2e2a 100644 --- a/src/SonsOfPHP/Bridge/Twig/Money/composer.json +++ b/src/SonsOfPHP/Bridge/Twig/Money/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/money": "^0.3.x-dev", "twig/twig": "^3.0" }, @@ -55,4 +55,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bundle/Cqrs/composer.json b/src/SonsOfPHP/Bundle/Cqrs/composer.json index 75af958d..a6143571 100644 --- a/src/SonsOfPHP/Bundle/Cqrs/composer.json +++ b/src/SonsOfPHP/Bundle/Cqrs/composer.json @@ -37,7 +37,7 @@ } }, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/cqrs": "^0.3.x-dev", "symfony/dependency-injection": "^5 || ^6 || ^7", "symfony/http-kernel": "^5 || ^6 || ^7", @@ -62,4 +62,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Bundle/FeatureToggleBundle/composer.json b/src/SonsOfPHP/Bundle/FeatureToggleBundle/composer.json index 9ba60a3a..3ad2108f 100644 --- a/src/SonsOfPHP/Bundle/FeatureToggleBundle/composer.json +++ b/src/SonsOfPHP/Bundle/FeatureToggleBundle/composer.json @@ -34,7 +34,7 @@ } ], "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/feature-toggle": "^0.3@dev" }, "autoload": { diff --git a/src/SonsOfPHP/Component/Assert/composer.json b/src/SonsOfPHP/Component/Assert/composer.json index 25387d75..2c72a537 100644 --- a/src/SonsOfPHP/Component/Assert/composer.json +++ b/src/SonsOfPHP/Component/Assert/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -51,4 +51,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Cache/SimpleCache.php b/src/SonsOfPHP/Component/Cache/SimpleCache.php index 5b06b1a5..73f0aeba 100644 --- a/src/SonsOfPHP/Component/Cache/SimpleCache.php +++ b/src/SonsOfPHP/Component/Cache/SimpleCache.php @@ -36,7 +36,7 @@ public function get(string $key, mixed $default = null): mixed /** * {@inheritdoc} */ - public function set(string $key, mixed $value, null|int|DateInterval $ttl = null): bool + public function set(string $key, mixed $value, int|DateInterval|null $ttl = null): bool { $item = $this->pool->getItem($key); $item->set($value); @@ -78,7 +78,7 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable /** * {@inheritdoc} */ - public function setMultiple(iterable $values, null|int|DateInterval $ttl = null): bool + public function setMultiple(iterable $values, int|DateInterval|null $ttl = null): bool { foreach ($values as $key => $value) { $this->set($key, $value, $ttl); diff --git a/src/SonsOfPHP/Component/Cache/composer.json b/src/SonsOfPHP/Component/Cache/composer.json index 0b3b9cff..30f97532 100644 --- a/src/SonsOfPHP/Component/Cache/composer.json +++ b/src/SonsOfPHP/Component/Cache/composer.json @@ -36,7 +36,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/cache": "^2.0 || ^3.0", "psr/log": "^2.0 || ^3.0", "psr/simple-cache": "^2.0 || ^3.0" @@ -68,4 +68,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Clock/composer.json b/src/SonsOfPHP/Component/Clock/composer.json index 75be26f9..b5bd7e28 100644 --- a/src/SonsOfPHP/Component/Clock/composer.json +++ b/src/SonsOfPHP/Component/Clock/composer.json @@ -44,7 +44,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/clock": "^1.0" }, "extra": { @@ -63,4 +63,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Container/Tests/ContainerTest.php b/src/SonsOfPHP/Component/Container/Tests/ContainerTest.php index 5916161e..6c129364 100644 --- a/src/SonsOfPHP/Component/Container/Tests/ContainerTest.php +++ b/src/SonsOfPHP/Component/Container/Tests/ContainerTest.php @@ -65,7 +65,7 @@ public function testSet(): void { $container = new Container(); $services = new ReflectionProperty($container, 'services'); - $this->assertCount(0, $services->getValue($container)); + $this->assertEmpty($services->getValue($container)); $container->set('service.id', function (): void {}); $this->assertCount(1, $services->getValue($container)); diff --git a/src/SonsOfPHP/Component/Container/composer.json b/src/SonsOfPHP/Component/Container/composer.json index 0b49c857..7e6e3c5d 100644 --- a/src/SonsOfPHP/Component/Container/composer.json +++ b/src/SonsOfPHP/Component/Container/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/container": "^1.0 || ^2.0" }, "provide": { @@ -57,4 +57,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Cookie/composer.json b/src/SonsOfPHP/Component/Cookie/composer.json index 97464bc8..a81ebe29 100644 --- a/src/SonsOfPHP/Component/Cookie/composer.json +++ b/src/SonsOfPHP/Component/Cookie/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/cookie-contract": "0.3.x-dev" }, "provide": { @@ -55,4 +55,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Cqrs/composer.json b/src/SonsOfPHP/Component/Cqrs/composer.json index d7e31c04..d31f27a2 100644 --- a/src/SonsOfPHP/Component/Cqrs/composer.json +++ b/src/SonsOfPHP/Component/Cqrs/composer.json @@ -37,7 +37,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/cqrs-contract": "0.3.x-dev" }, "require-dev": { @@ -66,4 +66,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/EventDispatcher/Tests/ListenerProviderTest.php b/src/SonsOfPHP/Component/EventDispatcher/Tests/ListenerProviderTest.php index a4ee3005..1f369326 100644 --- a/src/SonsOfPHP/Component/EventDispatcher/Tests/ListenerProviderTest.php +++ b/src/SonsOfPHP/Component/EventDispatcher/Tests/ListenerProviderTest.php @@ -28,7 +28,7 @@ public function testGetListenersForUnknownEventReturnsEmptyArray(): void $provider = new ListenerProvider(); $event = new stdClass(); $listeners = $provider->getListenersForEvent($event); - $this->assertCount(0, $listeners); + $this->assertEmpty($listeners); } public function testGetListenersForEvent(): void @@ -71,10 +71,10 @@ public function handle(): void {} $provider = new ListenerProvider(); - $this->assertCount(0, $provider->getListenersForEventName('event.one')); - $this->assertCount(0, $provider->getListenersForEventName('event.two')); - $this->assertCount(0, $provider->getListenersForEventName('event.three')); - $this->assertCount(0, $provider->getListenersForEventName('event.four')); + $this->assertEmpty($provider->getListenersForEventName('event.one')); + $this->assertEmpty($provider->getListenersForEventName('event.two')); + $this->assertEmpty($provider->getListenersForEventName('event.three')); + $this->assertEmpty($provider->getListenersForEventName('event.four')); $provider->addSubscriber($subscriber); $this->assertCount(1, $provider->getListenersForEventName('event.one')); $this->assertCount(1, $provider->getListenersForEventName('event.two')); diff --git a/src/SonsOfPHP/Component/EventDispatcher/composer.json b/src/SonsOfPHP/Component/EventDispatcher/composer.json index fce147a5..fa07f6db 100644 --- a/src/SonsOfPHP/Component/EventDispatcher/composer.json +++ b/src/SonsOfPHP/Component/EventDispatcher/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/event-dispatcher": "^1.0" }, "provide": { @@ -56,4 +56,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/AbstractAggregateTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/AbstractAggregateTest.php index 86a269fc..c2fdd29b 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/AbstractAggregateTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/AbstractAggregateTest.php @@ -50,7 +50,7 @@ public function testRaiseEventWillAddEventToPendingEvents(): void $message = $this->createMock(MessageInterface::class); $aggregate = new FakeAggregate('id'); - $this->assertCount(0, $aggregate->getPendingEvents()); + $this->assertEmpty($aggregate->getPendingEvents()); $refObj = new ReflectionObject($aggregate); $refMet = $refObj->getMethod('raiseEvent'); @@ -80,7 +80,7 @@ public function testItWillRaiseExceptionWithInvalidId(): void public function testPeekWillNotRemoveAnyPendingEvents(): void { $aggregate = new FakeAggregate('id'); - $this->assertCount(0, $aggregate->peekPendingEvents()); + $this->assertEmpty($aggregate->peekPendingEvents()); $method = new ReflectionMethod($aggregate, 'raiseEvent'); $message = $this->createMock(MessageInterface::class); diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php index 72ef56a0..f9960630 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Aggregate/Repository/AggregateRepositoryTest.php @@ -11,6 +11,7 @@ use SonsOfPHP\Component\EventSourcing\Aggregate\AbstractAggregate; use SonsOfPHP\Component\EventSourcing\Aggregate\AbstractAggregateId; use SonsOfPHP\Component\EventSourcing\Aggregate\AggregateId; +use SonsOfPHP\Component\EventSourcing\Aggregate\AggregateInterface; use SonsOfPHP\Component\EventSourcing\Aggregate\AggregateVersion; use SonsOfPHP\Component\EventSourcing\Aggregate\Repository\AggregateRepository; use SonsOfPHP\Component\EventSourcing\Aggregate\Repository\AggregateRepositoryInterface; @@ -135,6 +136,6 @@ public function testItReturnsNullWhenAggregateNotFound(): void $this->messageRepository ); - $this->assertNull($repository->find('unique-id')); + $this->assertNotInstanceOf(AggregateInterface::class, $repository->find('unique-id')); } } diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php index 829bf215..b316f8e1 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/AbstractMessageTest.php @@ -116,7 +116,7 @@ public function testGetPayloadHasEmptyArraryAsDefaultValue(): void { $message = $this->createMock(AbstractMessage::class)::new(); - $this->assertCount(0, $message->getPayload()); + $this->assertEmpty($message->getPayload()); } public function testWithPayloadReturnsNewStatic(): void diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Upcaster/Provider/EventTypeMessageUpcasterProviderTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Upcaster/Provider/EventTypeMessageUpcasterProviderTest.php index 0fd2f28d..4e939efd 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Upcaster/Provider/EventTypeMessageUpcasterProviderTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Message/Upcaster/Provider/EventTypeMessageUpcasterProviderTest.php @@ -32,7 +32,7 @@ public function testGetUpcastersForEventDataWillReturnEmptyArrayWhenNoHandlers() ]; $handlers = $provider->getUpcastersForEventData($eventData); - $this->assertCount(0, iterator_to_array($handlers)); + $this->assertEmpty(iterator_to_array($handlers)); } public function testGetUpcastersForEventDataWillThrowExceptionWhenCannotFindEventType(): void diff --git a/src/SonsOfPHP/Component/EventSourcing/Tests/Snapshot/Repository/InMemorySnapshotRepositoryTest.php b/src/SonsOfPHP/Component/EventSourcing/Tests/Snapshot/Repository/InMemorySnapshotRepositoryTest.php index 222e5ceb..46adc74e 100644 --- a/src/SonsOfPHP/Component/EventSourcing/Tests/Snapshot/Repository/InMemorySnapshotRepositoryTest.php +++ b/src/SonsOfPHP/Component/EventSourcing/Tests/Snapshot/Repository/InMemorySnapshotRepositoryTest.php @@ -13,6 +13,7 @@ use SonsOfPHP\Component\EventSourcing\Snapshot\Repository\InMemorySnapshotRepository; use SonsOfPHP\Component\EventSourcing\Snapshot\Repository\SnapshotRepositoryInterface; use SonsOfPHP\Component\EventSourcing\Snapshot\Snapshot; +use SonsOfPHP\Component\EventSourcing\Snapshot\SnapshotInterface; #[CoversClass(InMemorySnapshotRepository::class)] #[UsesClass(AbstractAggregateId::class)] @@ -41,6 +42,6 @@ public function testFindReturnsNullIfNoSnapshotFound(): void { $repository = new InMemorySnapshotRepository(); - $this->assertNull($repository->find(AggregateId::fromString('id'))); + $this->assertNotInstanceOf(SnapshotInterface::class, $repository->find(AggregateId::fromString('id'))); } } diff --git a/src/SonsOfPHP/Component/EventSourcing/composer.json b/src/SonsOfPHP/Component/EventSourcing/composer.json index 18e9a546..e5560507 100644 --- a/src/SonsOfPHP/Component/EventSourcing/composer.json +++ b/src/SonsOfPHP/Component/EventSourcing/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/event-sourcing-contract": "^0.3.x-dev", "sonsofphp/event-dispatcher": "^0.3.x-dev" }, @@ -63,4 +63,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/FeatureToggle/composer.json b/src/SonsOfPHP/Component/FeatureToggle/composer.json index 88340cf8..32336ae2 100644 --- a/src/SonsOfPHP/Component/FeatureToggle/composer.json +++ b/src/SonsOfPHP/Component/FeatureToggle/composer.json @@ -39,7 +39,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/feature-toggle-contract": "0.3.x-dev" }, "provide": { @@ -61,4 +61,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Filesystem/composer.json b/src/SonsOfPHP/Component/Filesystem/composer.json index 3987ca1e..1ac01dd5 100644 --- a/src/SonsOfPHP/Component/Filesystem/composer.json +++ b/src/SonsOfPHP/Component/Filesystem/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/filesystem-contract": "0.3.x-dev" }, "provide": { @@ -57,4 +57,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/HttpFactory/composer.json b/src/SonsOfPHP/Component/HttpFactory/composer.json index ebe75d0d..cbb7c4be 100644 --- a/src/SonsOfPHP/Component/HttpFactory/composer.json +++ b/src/SonsOfPHP/Component/HttpFactory/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/http-factory": "^1.0", "sonsofphp/http-message": "^0.3.x-dev" }, @@ -61,4 +61,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/HttpHandler/Tests/MiddlewareStackTest.php b/src/SonsOfPHP/Component/HttpHandler/Tests/MiddlewareStackTest.php index 0d2cd5e4..116cf0ab 100644 --- a/src/SonsOfPHP/Component/HttpHandler/Tests/MiddlewareStackTest.php +++ b/src/SonsOfPHP/Component/HttpHandler/Tests/MiddlewareStackTest.php @@ -30,7 +30,7 @@ public function testAdd(): void { $stack = new MiddlewareStack(); $middlewares = new ReflectionProperty($stack, 'middlewares'); - $this->assertCount(0, $middlewares->getValue($stack)); + $this->assertEmpty($middlewares->getValue($stack)); $stack->add(function (): void {}); $this->assertCount(1, $middlewares->getValue($stack)); @@ -39,7 +39,7 @@ public function testAdd(): void public function testCount(): void { $stack = new MiddlewareStack(); - $this->assertCount(0, $stack); + $this->assertEmpty($stack); $stack->add(function (): void {}); $this->assertCount(1, $stack); @@ -49,7 +49,7 @@ public function testAddWillPrioritizeCorrectly(): void { $stack = new MiddlewareStack(); $middlewares = new ReflectionProperty($stack, 'middlewares'); - $this->assertCount(0, $middlewares->getValue($stack)); + $this->assertEmpty($middlewares->getValue($stack)); $one = function (): void {}; $two = function (): void {}; diff --git a/src/SonsOfPHP/Component/HttpHandler/composer.json b/src/SonsOfPHP/Component/HttpHandler/composer.json index 543dfb3f..97bcfbbf 100644 --- a/src/SonsOfPHP/Component/HttpHandler/composer.json +++ b/src/SonsOfPHP/Component/HttpHandler/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/http-handler-contract": "0.3.x-dev", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0" @@ -64,4 +64,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/HttpMessage/ServerRequest.php b/src/SonsOfPHP/Component/HttpMessage/ServerRequest.php index 94105785..ed367ec9 100644 --- a/src/SonsOfPHP/Component/HttpMessage/ServerRequest.php +++ b/src/SonsOfPHP/Component/HttpMessage/ServerRequest.php @@ -22,7 +22,7 @@ class ServerRequest extends Request implements ServerRequestInterface private array $attributes = []; - private null|array|object $data = null; + private array|object|null $data = null; public function __construct( ?string $method = null, @@ -111,7 +111,7 @@ public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface /** * {@inheritdoc} */ - public function getParsedBody(): null|array|object + public function getParsedBody(): array|object|null { return $this->data ?? null; } diff --git a/src/SonsOfPHP/Component/HttpMessage/Tests/MessageTest.php b/src/SonsOfPHP/Component/HttpMessage/Tests/MessageTest.php index f53dbb0b..924e50c4 100644 --- a/src/SonsOfPHP/Component/HttpMessage/Tests/MessageTest.php +++ b/src/SonsOfPHP/Component/HttpMessage/Tests/MessageTest.php @@ -41,7 +41,7 @@ public function testItHasNoDefaultHeaders(): void { $msg = new Message(); - $this->assertCount(0, $msg->getHeaders()); + $this->assertEmpty($msg->getHeaders()); } public function testWithHeaderWorksAsExpectedWithStringValue(): void @@ -81,7 +81,7 @@ public function testHasHeaderWorksAsExpected(): void public function testGetHeaderWorksAsExpected(): void { $msg = new Message(); - $this->assertCount(0, $msg->getHeader('content-type')); + $this->assertEmpty($msg->getHeader('content-type')); $msg = $msg->withHeader('content-type', 'application/json'); $this->assertCount(1, $msg->getHeader('content-type')); $this->assertSame('application/json', $msg->getHeader('content-type')[0]); @@ -120,7 +120,7 @@ public function testWithoutHeaderWorksAsExpected(): void $msg = $message->withoutHeader('content-type'); $this->assertNotSame($message, $msg); - $this->assertCount(0, $msg->getHeader('content-type')); + $this->assertEmpty($msg->getHeader('content-type')); } public function testWithBodyWorksAsExpected(): void @@ -141,7 +141,7 @@ public function testGetBodyWorksAsExpected(): void public function testWithAddedHeaderWhenHeaderDoesNotExist(): void { $message = new Message(); - $this->assertCount(0, $message->getHeader('content-type')); + $this->assertEmpty($message->getHeader('content-type')); $msg = $message->withAddedHeader('content-type', 'text/html'); $this->assertNotSame($message, $msg); @@ -151,10 +151,10 @@ public function testWithAddedHeaderWhenHeaderDoesNotExist(): void public function testWithoutHeaderWorksAsExpectedWhenHeaderDoesNotExist(): void { $message = new Message(); - $this->assertCount(0, $message->getHeader('content-type')); + $this->assertEmpty($message->getHeader('content-type')); $msg = $message->withoutHeader('content-type'); $this->assertSame($message, $msg); - $this->assertCount(0, $msg->getHeader('content-type')); + $this->assertEmpty($msg->getHeader('content-type')); } } diff --git a/src/SonsOfPHP/Component/HttpMessage/Tests/ServerRequestTest.php b/src/SonsOfPHP/Component/HttpMessage/Tests/ServerRequestTest.php index 88b97a78..0d90d7fa 100644 --- a/src/SonsOfPHP/Component/HttpMessage/Tests/ServerRequestTest.php +++ b/src/SonsOfPHP/Component/HttpMessage/Tests/ServerRequestTest.php @@ -23,7 +23,7 @@ public function testItImplementsCorrectInterface(): void public function testGetAttributesWorksAsExpected(): void { $req = new ServerRequest(); - $this->assertCount(0, $req->getAttributes()); + $this->assertEmpty($req->getAttributes()); } public function testGetAttributeWorksAsExpected(): void @@ -45,7 +45,7 @@ public function testWithAttributeWorksAsExpected(): void $req = $request->withAttribute('controller', __METHOD__); $this->assertNotSame($request, $req); - $this->assertCount(0, $request->getAttributes()); + $this->assertEmpty($request->getAttributes()); $this->assertCount(1, $req->getAttributes()); } @@ -57,7 +57,7 @@ public function testWithoutAttributeWorksAsExpected(): void $req = $request->withoutAttribute('controller'); $this->assertNotSame($request, $req); $this->assertCount(1, $request->getAttributes()); - $this->assertCount(0, $req->getAttributes()); + $this->assertEmpty($req->getAttributes()); } public function testGetServerParamsWorksAsExpected(): void @@ -70,7 +70,7 @@ public function testGetServerParamsWorksAsExpected(): void public function testGetCookieParamsWorksAsExpected(): void { $req = new ServerRequest(); - $this->assertCount(0, $req->getCookieParams()); + $this->assertEmpty($req->getCookieParams()); } public function testWithCookieParamsWorksAsExpected(): void @@ -79,14 +79,14 @@ public function testWithCookieParamsWorksAsExpected(): void $req = $request->withCookieParams(['name' => 'test']); $this->assertNotSame($request, $req); - $this->assertCount(0, $request->getCookieParams()); + $this->assertEmpty($request->getCookieParams()); $this->assertCount(1, $req->getCookieParams()); } public function testGetQueryParamsWorksAsExpected(): void { $req = new ServerRequest(); - $this->assertCount(0, $req->getQueryParams()); + $this->assertEmpty($req->getQueryParams()); } public function testWithQueryParamsWorksAsExpected(): void @@ -95,14 +95,14 @@ public function testWithQueryParamsWorksAsExpected(): void $req = $request->withQueryParams(['name' => 'test']); $this->assertNotSame($request, $req); - $this->assertCount(0, $request->getQueryParams()); + $this->assertEmpty($request->getQueryParams()); $this->assertCount(1, $req->getQueryParams()); } public function testGetUploadedFilesWorksAsExpected(): void { $req = new ServerRequest(); - $this->assertCount(0, $req->getUploadedFiles()); + $this->assertEmpty($req->getUploadedFiles()); } public function testWithUploadedFilesWorksAsExpected(): void @@ -111,7 +111,7 @@ public function testWithUploadedFilesWorksAsExpected(): void $req = $request->withUploadedFiles(['name' => 'test']); $this->assertNotSame($request, $req); - $this->assertCount(0, $request->getUploadedFiles()); + $this->assertEmpty($request->getUploadedFiles()); $this->assertCount(1, $req->getUploadedFiles()); } diff --git a/src/SonsOfPHP/Component/HttpMessage/Uri.php b/src/SonsOfPHP/Component/HttpMessage/Uri.php index 20f9ff2d..6a2517ea 100644 --- a/src/SonsOfPHP/Component/HttpMessage/Uri.php +++ b/src/SonsOfPHP/Component/HttpMessage/Uri.php @@ -285,13 +285,13 @@ public function withFragment(string $fragment): UriInterface */ public function __toString(): string { - return ($this->scheme !== '' && $this->scheme !== '0' ? $this->scheme . '://' : '') . - ($this->getUserInfo() !== '' && $this->getUserInfo() !== '0' ? $this->getUserInfo() . '@' : '') . - ($this->getHost()) . - ($this->port !== null && $this->port !== 0 ? ':' . $this->port : '') . - ($this->getPath() ?? '') . - ($this->getQuery() !== '' && $this->getQuery() !== '0' ? '?' . $this->getQuery() : '') . - ($this->getFragment() !== '' && $this->getFragment() !== '0' ? '#' . $this->getFragment() : '') + return ($this->scheme !== '' && $this->scheme !== '0' ? $this->scheme . '://' : '') + . ($this->getUserInfo() !== '' && $this->getUserInfo() !== '0' ? $this->getUserInfo() . '@' : '') + . ($this->getHost()) + . ($this->port !== null && $this->port !== 0 ? ':' . $this->port : '') + . ($this->getPath() ?? '') + . ($this->getQuery() !== '' && $this->getQuery() !== '0' ? '?' . $this->getQuery() : '') + . ($this->getFragment() !== '' && $this->getFragment() !== '0' ? '#' . $this->getFragment() : '') ; } diff --git a/src/SonsOfPHP/Component/HttpMessage/composer.json b/src/SonsOfPHP/Component/HttpMessage/composer.json index 9c146ef2..1090dd75 100644 --- a/src/SonsOfPHP/Component/HttpMessage/composer.json +++ b/src/SonsOfPHP/Component/HttpMessage/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/http-message": "^1.0 || ^2.0" }, "suggest": { @@ -61,4 +61,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Json/composer.json b/src/SonsOfPHP/Component/Json/composer.json index 513a8aad..cf704b8a 100644 --- a/src/SonsOfPHP/Component/Json/composer.json +++ b/src/SonsOfPHP/Component/Json/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "ext-json": "*" }, "extra": { @@ -52,4 +52,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Link/Tests/EvolvableLinkProviderTest.php b/src/SonsOfPHP/Component/Link/Tests/EvolvableLinkProviderTest.php index 6c9b2f43..ed7623f5 100644 --- a/src/SonsOfPHP/Component/Link/Tests/EvolvableLinkProviderTest.php +++ b/src/SonsOfPHP/Component/Link/Tests/EvolvableLinkProviderTest.php @@ -27,7 +27,7 @@ public function testItHasTheCorrectInterface(): void public function testWithLink(): void { $provider = new EvolvableLinkProvider(); - $this->assertCount(0, $provider->getLinks()); + $this->assertEmpty($provider->getLinks()); $provider = $provider->withLink(new Link('https://docs.sonsofphp.com')); $this->assertCount(1, $provider->getLinks()); @@ -39,6 +39,6 @@ public function testWithoutLink(): void $link = new Link('https://docs.sonsofphp.com'), ]); $this->assertCount(1, $provider->getLinks()); - $this->assertCount(0, $provider->withoutLink($link)->getLinks()); + $this->assertEmpty($provider->withoutLink($link)->getLinks()); } } diff --git a/src/SonsOfPHP/Component/Link/Tests/LinkProviderTest.php b/src/SonsOfPHP/Component/Link/Tests/LinkProviderTest.php index 851c54c5..c194ee61 100644 --- a/src/SonsOfPHP/Component/Link/Tests/LinkProviderTest.php +++ b/src/SonsOfPHP/Component/Link/Tests/LinkProviderTest.php @@ -43,7 +43,7 @@ public function testGetLinks(): void { $provider = new LinkProvider(); - $this->assertCount(0, $provider->getLinks()); + $this->assertEmpty($provider->getLinks()); } public function testGetLinksByRel(): void diff --git a/src/SonsOfPHP/Component/Link/Tests/LinkTest.php b/src/SonsOfPHP/Component/Link/Tests/LinkTest.php index 233148d5..1c5ea01e 100644 --- a/src/SonsOfPHP/Component/Link/Tests/LinkTest.php +++ b/src/SonsOfPHP/Component/Link/Tests/LinkTest.php @@ -62,13 +62,13 @@ public function testGetRels(): void { $link = new Link('https://docs.sonsofphp.com'); - $this->assertCount(0, $link->getRels()); + $this->assertEmpty($link->getRels()); } public function testGetAttributes(): void { $link = new Link('https://docs.sonsofphp.com'); - $this->assertCount(0, $link->getAttributes()); + $this->assertEmpty($link->getAttributes()); } } diff --git a/src/SonsOfPHP/Component/Link/composer.json b/src/SonsOfPHP/Component/Link/composer.json index b2ea8986..53e780d0 100644 --- a/src/SonsOfPHP/Component/Link/composer.json +++ b/src/SonsOfPHP/Component/Link/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/link": "^1.0 || ^2.0" }, "provide": { @@ -57,4 +57,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Logger/Tests/LevelTest.php b/src/SonsOfPHP/Component/Logger/Tests/LevelTest.php index 3c33f279..a9817bdf 100644 --- a/src/SonsOfPHP/Component/Logger/Tests/LevelTest.php +++ b/src/SonsOfPHP/Component/Logger/Tests/LevelTest.php @@ -41,7 +41,7 @@ public function testFromName(): void public function testTryFromNameWithInvalidName(): void { - $this->assertNull(Level::tryFromName('invalid name')); + $this->assertNotInstanceOf(LevelInterface::class, Level::tryFromName('invalid name')); } public function testTryFromName(): void diff --git a/src/SonsOfPHP/Component/Logger/Tests/LoggerTest.php b/src/SonsOfPHP/Component/Logger/Tests/LoggerTest.php index cb9716af..254f0946 100644 --- a/src/SonsOfPHP/Component/Logger/Tests/LoggerTest.php +++ b/src/SonsOfPHP/Component/Logger/Tests/LoggerTest.php @@ -90,7 +90,7 @@ public function testaddEnricher(): void { $logger = new Logger(); $enrichers = new ReflectionProperty($logger, 'enrichers'); - $this->assertCount(0, $enrichers->getValue($logger)); + $this->assertEmpty($enrichers->getValue($logger)); $logger->addEnricher(new NullEnricher()); $this->assertCount(1, $enrichers->getValue($logger)); @@ -103,7 +103,7 @@ public function testaddHandler(): void { $logger = new Logger(); $handlers = new ReflectionProperty($logger, 'handlers'); - $this->assertCount(0, $handlers->getValue($logger)); + $this->assertEmpty($handlers->getValue($logger)); $logger->addHandler(new NullHandler()); $this->assertCount(1, $handlers->getValue($logger)); diff --git a/src/SonsOfPHP/Component/Logger/composer.json b/src/SonsOfPHP/Component/Logger/composer.json index dad7d27b..5785bd50 100644 --- a/src/SonsOfPHP/Component/Logger/composer.json +++ b/src/SonsOfPHP/Component/Logger/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/log": "^2.0 || ^3.0", "sonsofphp/logger-contract": "0.3.x-dev" }, @@ -59,4 +59,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Mailer/Tests/MessageTest.php b/src/SonsOfPHP/Component/Mailer/Tests/MessageTest.php index 68f94ad8..31df5bc1 100644 --- a/src/SonsOfPHP/Component/Mailer/Tests/MessageTest.php +++ b/src/SonsOfPHP/Component/Mailer/Tests/MessageTest.php @@ -40,7 +40,7 @@ public function testGetBody(): void public function testGetHeadersWhenEmpty(): void { $message = new Message(); - $this->assertCount(0, $message->getHeaders()); + $this->assertEmpty($message->getHeaders()); } public function testGetHeader(): void diff --git a/src/SonsOfPHP/Component/Mailer/Tests/MiddlewareStackTest.php b/src/SonsOfPHP/Component/Mailer/Tests/MiddlewareStackTest.php index d3f454ad..91770172 100644 --- a/src/SonsOfPHP/Component/Mailer/Tests/MiddlewareStackTest.php +++ b/src/SonsOfPHP/Component/Mailer/Tests/MiddlewareStackTest.php @@ -37,7 +37,7 @@ public function __invoke(MessageInterface $message, MiddlewareHandlerInterface $ $stack = new MiddlewareStack(); - $this->assertCount(0, $property->getValue($stack)); + $this->assertEmpty($property->getValue($stack)); $stack->add($middleware); $this->assertCount(1, $property->getValue($stack)); } diff --git a/src/SonsOfPHP/Component/Mailer/composer.json b/src/SonsOfPHP/Component/Mailer/composer.json index 9120df11..00090374 100644 --- a/src/SonsOfPHP/Component/Mailer/composer.json +++ b/src/SonsOfPHP/Component/Mailer/composer.json @@ -33,7 +33,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/mailer-contract": "0.3.x-dev" }, "provide": { @@ -55,4 +55,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Money/composer.json b/src/SonsOfPHP/Component/Money/composer.json index 5ee73e4c..c92441fa 100644 --- a/src/SonsOfPHP/Component/Money/composer.json +++ b/src/SonsOfPHP/Component/Money/composer.json @@ -36,7 +36,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "ext-intl": "*", "sonsofphp/money-contract": "0.3.x-dev" }, @@ -59,4 +59,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Pager/Tests/Adapter/ArrayAdapterTest.php b/src/SonsOfPHP/Component/Pager/Tests/Adapter/ArrayAdapterTest.php index 915c8d90..30ce3693 100644 --- a/src/SonsOfPHP/Component/Pager/Tests/Adapter/ArrayAdapterTest.php +++ b/src/SonsOfPHP/Component/Pager/Tests/Adapter/ArrayAdapterTest.php @@ -24,7 +24,7 @@ public function testCount(): void { $adapter = new ArrayAdapter([]); - $this->assertCount(0, $adapter); + $this->assertEmpty($adapter); } public function testGetSlice(): void diff --git a/src/SonsOfPHP/Component/Pager/Tests/PagerTest.php b/src/SonsOfPHP/Component/Pager/Tests/PagerTest.php index 47b4e7a4..26c3d83c 100644 --- a/src/SonsOfPHP/Component/Pager/Tests/PagerTest.php +++ b/src/SonsOfPHP/Component/Pager/Tests/PagerTest.php @@ -44,7 +44,7 @@ public function testGetCurrentPageResults(): void { $pager = new Pager(new ArrayAdapter([])); - $this->assertCount(0, $pager->getCurrentPageResults()); + $this->assertEmpty($pager->getCurrentPageResults()); } public function testGetTotalResults(): void @@ -184,8 +184,8 @@ public function testCount(): void { $pager = new Pager(new ArrayAdapter([])); - $this->assertCount(0, $pager); - $this->assertCount(0, $pager); + $this->assertEmpty($pager); + $this->assertEmpty($pager); } public function testGetIteratorWhenGenerator(): void diff --git a/src/SonsOfPHP/Component/Pager/composer.json b/src/SonsOfPHP/Component/Pager/composer.json index 36547d3e..11c70273 100644 --- a/src/SonsOfPHP/Component/Pager/composer.json +++ b/src/SonsOfPHP/Component/Pager/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/pager-contract": "0.3.x-dev" }, "provide": { @@ -56,4 +56,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Registry/Tests/ServiceRegistryTest.php b/src/SonsOfPHP/Component/Registry/Tests/ServiceRegistryTest.php index 55442e99..2b9105ef 100644 --- a/src/SonsOfPHP/Component/Registry/Tests/ServiceRegistryTest.php +++ b/src/SonsOfPHP/Component/Registry/Tests/ServiceRegistryTest.php @@ -29,7 +29,7 @@ public function testItHasTheCorrectInterface(): void public function testItCanRegisterNewServices(): void { $identifier = 'exception'; - $this->assertCount(0, $this->registry->all()); + $this->assertEmpty($this->registry->all()); $this->assertFalse($this->registry->has($identifier)); $this->registry->register($identifier, new \Exception()); $this->assertCount(1, $this->registry->all()); diff --git a/src/SonsOfPHP/Component/Registry/composer.json b/src/SonsOfPHP/Component/Registry/composer.json index d1449ad9..80c48a61 100644 --- a/src/SonsOfPHP/Component/Registry/composer.json +++ b/src/SonsOfPHP/Component/Registry/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/registry-contract": "0.3.x-dev" }, "provide": { @@ -56,4 +56,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/StateMachine/composer.json b/src/SonsOfPHP/Component/StateMachine/composer.json index 5913b5d7..93e3ec71 100644 --- a/src/SonsOfPHP/Component/StateMachine/composer.json +++ b/src/SonsOfPHP/Component/StateMachine/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/event-dispatcher": "0.3.x-dev", "sonsofphp/state-machine-contract": "0.3.x-dev" }, @@ -57,4 +57,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Component/Version/composer.json b/src/SonsOfPHP/Component/Version/composer.json index 5770da03..20d839ca 100644 --- a/src/SonsOfPHP/Component/Version/composer.json +++ b/src/SonsOfPHP/Component/Version/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "sonsofphp/version-contract": "0.3.x-dev" }, "provide": { @@ -56,4 +56,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Common/composer.json b/src/SonsOfPHP/Contract/Common/composer.json index 0578f55c..1d4ddcb2 100644 --- a/src/SonsOfPHP/Contract/Common/composer.json +++ b/src/SonsOfPHP/Contract/Common/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Cookie/composer.json b/src/SonsOfPHP/Contract/Cookie/composer.json index 245fbe63..11e2d523 100644 --- a/src/SonsOfPHP/Contract/Cookie/composer.json +++ b/src/SonsOfPHP/Contract/Cookie/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Cqrs/composer.json b/src/SonsOfPHP/Contract/Cqrs/composer.json index a49e7820..292541c4 100644 --- a/src/SonsOfPHP/Contract/Cqrs/composer.json +++ b/src/SonsOfPHP/Contract/Cqrs/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/EventSourcing/composer.json b/src/SonsOfPHP/Contract/EventSourcing/composer.json index 2718a5ef..61d5316d 100644 --- a/src/SonsOfPHP/Contract/EventSourcing/composer.json +++ b/src/SonsOfPHP/Contract/EventSourcing/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/FeatureToggle/composer.json b/src/SonsOfPHP/Contract/FeatureToggle/composer.json index b0ee1418..1bd837b3 100644 --- a/src/SonsOfPHP/Contract/FeatureToggle/composer.json +++ b/src/SonsOfPHP/Contract/FeatureToggle/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Filesystem/composer.json b/src/SonsOfPHP/Contract/Filesystem/composer.json index d8586b86..95f79a25 100644 --- a/src/SonsOfPHP/Contract/Filesystem/composer.json +++ b/src/SonsOfPHP/Contract/Filesystem/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/HttpHandler/composer.json b/src/SonsOfPHP/Contract/HttpHandler/composer.json index cc08afef..4ca3cbdf 100644 --- a/src/SonsOfPHP/Contract/HttpHandler/composer.json +++ b/src/SonsOfPHP/Contract/HttpHandler/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2", + "php": ">=8.3", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0" }, @@ -55,4 +55,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Logger/composer.json b/src/SonsOfPHP/Contract/Logger/composer.json index 8cc270a8..669c62be 100644 --- a/src/SonsOfPHP/Contract/Logger/composer.json +++ b/src/SonsOfPHP/Contract/Logger/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Mailer/composer.json b/src/SonsOfPHP/Contract/Mailer/composer.json index 2961ff35..3101d187 100644 --- a/src/SonsOfPHP/Contract/Mailer/composer.json +++ b/src/SonsOfPHP/Contract/Mailer/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Money/composer.json b/src/SonsOfPHP/Contract/Money/composer.json index b1c24763..54031707 100644 --- a/src/SonsOfPHP/Contract/Money/composer.json +++ b/src/SonsOfPHP/Contract/Money/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Pager/composer.json b/src/SonsOfPHP/Contract/Pager/composer.json index 771d6dc5..b0e2ce32 100644 --- a/src/SonsOfPHP/Contract/Pager/composer.json +++ b/src/SonsOfPHP/Contract/Pager/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Registry/composer.json b/src/SonsOfPHP/Contract/Registry/composer.json index bd572265..a692a088 100644 --- a/src/SonsOfPHP/Contract/Registry/composer.json +++ b/src/SonsOfPHP/Contract/Registry/composer.json @@ -37,7 +37,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -55,4 +55,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/StateMachine/composer.json b/src/SonsOfPHP/Contract/StateMachine/composer.json index d998385f..4aff1fb6 100644 --- a/src/SonsOfPHP/Contract/StateMachine/composer.json +++ b/src/SonsOfPHP/Contract/StateMachine/composer.json @@ -36,7 +36,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -54,4 +54,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/src/SonsOfPHP/Contract/Stdlib/composer.json b/src/SonsOfPHP/Contract/Stdlib/composer.json index 95c8218a..8ce136bf 100644 --- a/src/SonsOfPHP/Contract/Stdlib/composer.json +++ b/src/SonsOfPHP/Contract/Stdlib/composer.json @@ -32,7 +32,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, diff --git a/src/SonsOfPHP/Contract/Version/composer.json b/src/SonsOfPHP/Contract/Version/composer.json index 5b1b3a85..d8a3c15b 100644 --- a/src/SonsOfPHP/Contract/Version/composer.json +++ b/src/SonsOfPHP/Contract/Version/composer.json @@ -35,7 +35,7 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=8.2" + "php": ">=8.3" }, "extra": { "sort-packages": true, @@ -53,4 +53,4 @@ "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" } ] -} \ No newline at end of file +} diff --git a/tools/chorale/src/Composer/DependencyMerger.php b/tools/chorale/src/Composer/DependencyMerger.php index ee3e8fce..cdabbae2 100644 --- a/tools/chorale/src/Composer/DependencyMerger.php +++ b/tools/chorale/src/Composer/DependencyMerger.php @@ -36,7 +36,11 @@ public function computeRootMerge(string $projectRoot, array $packagePaths, array $packageName = strtolower((string) ($composerJson['name'] ?? $relativePath)); foreach ((array) ($composerJson['require'] ?? []) as $dependency => $version) { - if (!is_string($dependency) || !is_string($version)) { + if (!is_string($dependency)) { + continue; + } + + if (!is_string($version)) { continue; } @@ -48,7 +52,11 @@ public function computeRootMerge(string $projectRoot, array $packagePaths, array } foreach ((array) ($composerJson['require-dev'] ?? []) as $dependency => $version) { - if (!is_string($dependency) || !is_string($version)) { + if (!is_string($dependency)) { + continue; + } + + if (!is_string($version)) { continue; } diff --git a/tools/chorale/src/Config/ConfigLoader.php b/tools/chorale/src/Config/ConfigLoader.php index 0d3ce93e..e2ee4c40 100644 --- a/tools/chorale/src/Config/ConfigLoader.php +++ b/tools/chorale/src/Config/ConfigLoader.php @@ -6,10 +6,10 @@ use Symfony\Component\Yaml\Yaml; -final class ConfigLoader implements ConfigLoaderInterface +final readonly class ConfigLoader implements ConfigLoaderInterface { public function __construct( - private readonly string $fileName = 'chorale.yaml' + private string $fileName = 'chorale.yaml' ) {} public function load(string $projectRoot): array @@ -18,10 +18,12 @@ public function load(string $projectRoot): array if (!is_file($path)) { return []; } + $raw = file_get_contents($path); if ($raw === false) { - throw new \RuntimeException("Failed to read {$path}"); + throw new \RuntimeException('Failed to read ' . $path); } + $data = Yaml::parse($raw); return is_array($data) ? $data : []; } diff --git a/tools/chorale/src/Config/ConfigNormalizer.php b/tools/chorale/src/Config/ConfigNormalizer.php index aa651a0d..f6ea15c4 100644 --- a/tools/chorale/src/Config/ConfigNormalizer.php +++ b/tools/chorale/src/Config/ConfigNormalizer.php @@ -6,11 +6,11 @@ use Chorale\Util\SortingInterface; -final class ConfigNormalizer implements ConfigNormalizerInterface +final readonly class ConfigNormalizer implements ConfigNormalizerInterface { public function __construct( - private readonly SortingInterface $sorting, - private readonly ConfigDefaultsInterface $defaults + private SortingInterface $sorting, + private ConfigDefaultsInterface $defaults ) {} public function normalize(array $config): array @@ -27,6 +27,7 @@ public function normalize(array $config): array } } } + unset($p); $patterns = $this->sorting->sortPatterns($patterns); @@ -40,6 +41,7 @@ public function normalize(array $config): array } } } + unset($t); $targets = $this->sorting->sortTargets($targets); @@ -58,9 +60,11 @@ public function normalize(array $config): array if ($patterns !== []) { $out['patterns'] = $patterns; } + if ($targets !== []) { $out['targets'] = $targets; } + if (!empty($config['hooks'])) { $out['hooks'] = array_values((array) $config['hooks']); } diff --git a/tools/chorale/src/Config/ConfigWriter.php b/tools/chorale/src/Config/ConfigWriter.php index 024a69d1..e6b27102 100644 --- a/tools/chorale/src/Config/ConfigWriter.php +++ b/tools/chorale/src/Config/ConfigWriter.php @@ -7,11 +7,11 @@ use Chorale\IO\BackupManagerInterface; use Symfony\Component\Yaml\Yaml; -final class ConfigWriter implements ConfigWriterInterface +final readonly class ConfigWriter implements ConfigWriterInterface { public function __construct( - private readonly BackupManagerInterface $backup, - private readonly string $fileName = 'chorale.yaml' + private BackupManagerInterface $backup, + private string $fileName = 'chorale.yaml' ) {} public function write(string $projectRoot, array $config): void @@ -25,11 +25,12 @@ public function write(string $projectRoot, array $config): void $tmp = $path . '.tmp'; if (@file_put_contents($tmp, $yaml) === false) { - throw new \RuntimeException("Failed to write temp file: {$tmp}"); + throw new \RuntimeException('Failed to write temp file: ' . $tmp); } + if (!@rename($tmp, $path)) { @unlink($tmp); - throw new \RuntimeException("Failed to replace {$path}"); + throw new \RuntimeException('Failed to replace ' . $path); } } } diff --git a/tools/chorale/src/Config/SchemaValidator.php b/tools/chorale/src/Config/SchemaValidator.php index 8d39ed07..00287da1 100644 --- a/tools/chorale/src/Config/SchemaValidator.php +++ b/tools/chorale/src/Config/SchemaValidator.php @@ -17,7 +17,7 @@ public function validate(array $config, string $schemaPath): array $strKeys = ['repo_host','repo_vendor','repo_name_template','default_repo_template','default_branch','splitter','tag_strategy']; foreach ($strKeys as $k) { if (isset($config[$k]) && !is_string($config[$k])) { - $issues[] = "Key '{$k}' must be a string."; + $issues[] = sprintf("Key '%s' must be a string.", $k); } } @@ -28,9 +28,11 @@ public function validate(array $config, string $schemaPath): array if (isset($rules['keep_history']) && !is_bool($rules['keep_history'])) { $issues[] = "rules.keep_history must be a boolean."; } + if (isset($rules['skip_if_unchanged']) && !is_bool($rules['skip_if_unchanged'])) { $issues[] = "rules.skip_if_unchanged must be a boolean."; } + if (isset($rules['require_files']) && !is_array($rules['require_files'])) { $issues[] = "rules.require_files must be an array of strings."; } @@ -38,27 +40,30 @@ public function validate(array $config, string $schemaPath): array foreach (['patterns', 'targets', 'hooks'] as $listKey) { if (isset($config[$listKey]) && !is_array($config[$listKey])) { - $issues[] = "Key '{$listKey}' must be a list."; + $issues[] = sprintf("Key '%s' must be a list.", $listKey); } } if (isset($config['patterns']) && is_array($config['patterns'])) { foreach ($config['patterns'] as $i => $p) { if (!is_array($p)) { - $issues[] = "patterns[$i] must be an object."; + $issues[] = sprintf('patterns[%s] must be an object.', $i); continue; } + if (!isset($p['match']) || !is_string($p['match'])) { - $issues[] = "patterns[$i].match must be a string."; + $issues[] = sprintf('patterns[%s].match must be a string.', $i); } + foreach (['repo_host','repo_vendor','repo_name_template','repo'] as $k) { if (isset($p[$k]) && !is_string($p[$k])) { - $issues[] = "patterns[$i].{$k} must be a string."; + $issues[] = sprintf('patterns[%s].%s must be a string.', $i, $k); } } + foreach (['include','exclude'] as $k) { if (isset($p[$k]) && !is_array($p[$k])) { - $issues[] = "patterns[$i].{$k} must be a list of strings."; + $issues[] = sprintf('patterns[%s].%s must be a list of strings.', $i, $k); } } } @@ -67,17 +72,19 @@ public function validate(array $config, string $schemaPath): array if (isset($config['targets']) && is_array($config['targets'])) { foreach ($config['targets'] as $i => $t) { if (!is_array($t)) { - $issues[] = "targets[$i] must be an object."; + $issues[] = sprintf('targets[%s] must be an object.', $i); continue; } + foreach (['name','path','repo_host','repo_vendor','repo_name_template','repo'] as $k) { if (isset($t[$k]) && !is_string($t[$k])) { - $issues[] = "targets[$i].{$k} must be a string."; + $issues[] = sprintf('targets[%s].%s must be a string.', $i, $k); } } + foreach (['include','exclude'] as $k) { if (isset($t[$k]) && !is_array($t[$k])) { - $issues[] = "targets[$i].{$k} must be a list of strings."; + $issues[] = sprintf('targets[%s].%s must be a list of strings.', $i, $k); } } } diff --git a/tools/chorale/src/Console/ApplyCommand.php b/tools/chorale/src/Console/ApplyCommand.php index bda3aecd..c26b8de7 100644 --- a/tools/chorale/src/Console/ApplyCommand.php +++ b/tools/chorale/src/Console/ApplyCommand.php @@ -14,6 +14,7 @@ final class ApplyCommand extends Command { protected static $defaultName = 'apply'; + protected static $defaultDescription = 'Apply steps from a JSON plan.'; public function __construct( diff --git a/tools/chorale/src/Console/RunCommand.php b/tools/chorale/src/Console/RunCommand.php index 749fbe05..5c32c626 100644 --- a/tools/chorale/src/Console/RunCommand.php +++ b/tools/chorale/src/Console/RunCommand.php @@ -5,8 +5,8 @@ namespace Chorale\Console; use Chorale\Console\Style\ConsoleStyleFactory; -use Chorale\Run\RunnerInterface; use Chorale\Plan\PlanStepInterface; +use Chorale\Run\RunnerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -16,6 +16,7 @@ final class RunCommand extends Command { protected static $defaultName = 'run'; + protected static $defaultDescription = 'Plan and apply steps.'; public function __construct( @@ -65,8 +66,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'strict' => $strict, 'show_all' => $showAll, ]); - } catch (\RuntimeException $e) { - $io->error($e->getMessage()); + } catch (\RuntimeException $runtimeException) { + $io->error($runtimeException->getMessage()); return 2; } diff --git a/tools/chorale/src/Console/SetupCommand.php b/tools/chorale/src/Console/SetupCommand.php index ad6ad535..e58e9714 100644 --- a/tools/chorale/src/Console/SetupCommand.php +++ b/tools/chorale/src/Console/SetupCommand.php @@ -287,7 +287,7 @@ private function displayNameFor(string $projectRoot, string $pkgPath): string $abs = rtrim($projectRoot, '/') . '/' . ltrim($pkgPath, '/'); $meta = $this->composerMeta->read($abs); if (!empty($meta['name'])) { - $name = (string) $meta['name']; + $name = $meta['name']; // choose style: last segment after "/" for brevity $last = str_contains($name, '/') ? substr($name, strrpos($name, '/') + 1) : $name; return $last; @@ -348,7 +348,7 @@ private function classifyAll(string $root, array $defaults, array $patterns, arr private function classifyOne(string $root, string $pkgPath, array $defaults, array $patterns, array $targetsByPath): array { $matches = $this->matcher->allMatches($patterns, $pkgPath); - $pattern = $matches ? (array) $patterns[$matches[0]] : []; + $pattern = $matches !== [] ? (array) $patterns[$matches[0]] : []; $hasExplicitTarget = isset($targetsByPath[$pkgPath]); $name = basename($pkgPath); @@ -437,7 +437,7 @@ private function findRenameTarget(string $oldPath, array $target, array $default private function firstPatternFor(array $patterns, string $path): array { $idxs = $this->matcher->allMatches($patterns, $path); - return $idxs ? (array) $patterns[$idxs[0]] : []; + return $idxs !== [] ? (array) $patterns[$idxs[0]] : []; } // ───────────────────────────────────────────────────────────────────────────── diff --git a/tools/chorale/src/Console/Style/ConsoleStyleFactory.php b/tools/chorale/src/Console/Style/ConsoleStyleFactory.php index 387c1aff..3cf30d58 100644 --- a/tools/chorale/src/Console/Style/ConsoleStyleFactory.php +++ b/tools/chorale/src/Console/Style/ConsoleStyleFactory.php @@ -12,10 +12,10 @@ final class ConsoleStyleFactory { public function create(InputInterface $input, OutputInterface $output): SymfonyStyle { - $io = new class ($input, $output) extends SymfonyStyle { + return new class ($input, $output) extends SymfonyStyle { public function __construct( - private InputInterface $input, - private OutputInterface $output, + private readonly InputInterface $input, + private readonly OutputInterface $output, ) { parent::__construct($input, $output); } @@ -30,7 +30,5 @@ public function getOutput(): OutputInterface return $this->output; } }; - - return $io; } } diff --git a/tools/chorale/src/Diff/ConfigDiffer.php b/tools/chorale/src/Diff/ConfigDiffer.php index 816f17b2..b9025b84 100644 --- a/tools/chorale/src/Diff/ConfigDiffer.php +++ b/tools/chorale/src/Diff/ConfigDiffer.php @@ -59,7 +59,7 @@ public function diff(array $config, array $discovered, array $context): array foreach ($discovered as $pkgPath) { $matchIdxs = $this->matcher->allMatches($patterns, $pkgPath); - $pattern = $matchIdxs ? (array) $patterns[$matchIdxs[0]] : []; + $pattern = $matchIdxs !== [] ? (array) $patterns[$matchIdxs[0]] : []; $target = $targetsByPath[$pkgPath] ?? []; $name = $this->paths->leaf($pkgPath); @@ -173,6 +173,6 @@ public function diff(array $config, array $discovered, array $context): array private function findPatternFor(array $patterns, string $path): array { $idxs = $this->matcher->allMatches($patterns, $path); - return $idxs ? (array) $patterns[$idxs[0]] : []; + return $idxs !== [] ? (array) $patterns[$idxs[0]] : []; } } diff --git a/tools/chorale/src/Discovery/ComposerMetadata.php b/tools/chorale/src/Discovery/ComposerMetadata.php index 7004376f..5d70ad43 100644 --- a/tools/chorale/src/Discovery/ComposerMetadata.php +++ b/tools/chorale/src/Discovery/ComposerMetadata.php @@ -12,15 +12,18 @@ public function read(string $dir): array if (!is_file($file)) { return []; } + $raw = @file_get_contents($file); if ($raw === false) { return []; } + $json = json_decode($raw, true); if (!is_array($json)) { return []; } + $name = isset($json['name']) && is_string($json['name']) ? $json['name'] : null; - return $name ? ['name' => $name] : []; + return $name !== null && $name !== '' && $name !== '0' ? ['name' => $name] : []; } } diff --git a/tools/chorale/src/Discovery/PackageIdentity.php b/tools/chorale/src/Discovery/PackageIdentity.php index a7749b9c..cc4746e3 100644 --- a/tools/chorale/src/Discovery/PackageIdentity.php +++ b/tools/chorale/src/Discovery/PackageIdentity.php @@ -18,6 +18,7 @@ public function identityFor(string $path, ?string $repoUrl = null): string // Fallback: use leaf directory name (case-insensitive) $p = str_replace('\\', '/', $path); $p = rtrim($p, '/'); + $leaf = $p === '' ? '' : substr($p, (int) (strrpos($p, '/') ?: -1) + 1); return mb_strtolower($leaf); } diff --git a/tools/chorale/src/IO/BackupManager.php b/tools/chorale/src/IO/BackupManager.php index 4afd0e3a..c2cb26ea 100644 --- a/tools/chorale/src/IO/BackupManager.php +++ b/tools/chorale/src/IO/BackupManager.php @@ -10,10 +10,8 @@ public function backup(string $filePath): string { $dir = dirname($filePath); $backupDir = $dir . '/.chorale/backup'; - if (!is_dir($backupDir)) { - if (!@mkdir($backupDir, 0o775, true) && !is_dir($backupDir)) { - throw new \RuntimeException("Failed to create backup directory: {$backupDir}"); - } + if (!is_dir($backupDir) && (!@mkdir($backupDir, 0o775, true) && !is_dir($backupDir))) { + throw new \RuntimeException('Failed to create backup directory: ' . $backupDir); } $ts = (new \DateTimeImmutable('now'))->format('Ymd-His'); @@ -22,13 +20,11 @@ public function backup(string $filePath): string if (is_file($filePath)) { if (@copy($filePath, $dest) === false) { - throw new \RuntimeException("Failed to create backup file: {$dest}"); + throw new \RuntimeException('Failed to create backup file: ' . $dest); } - } else { + } elseif (@file_put_contents($dest, '') === false) { // Create an empty marker so rollback tooling has a reference - if (@file_put_contents($dest, '') === false) { - throw new \RuntimeException("Failed to create backup placeholder: {$dest}"); - } + throw new \RuntimeException('Failed to create backup placeholder: ' . $dest); } return $dest; @@ -37,10 +33,11 @@ public function backup(string $filePath): string public function restore(string $backupFilePath, string $targetPath): void { if (!is_file($backupFilePath)) { - throw new \RuntimeException("Backup file not found: {$backupFilePath}"); + throw new \RuntimeException('Backup file not found: ' . $backupFilePath); } + if (@copy($backupFilePath, $targetPath) === false) { - throw new \RuntimeException("Failed to restore backup to: {$targetPath}"); + throw new \RuntimeException('Failed to restore backup to: ' . $targetPath); } } } diff --git a/tools/chorale/src/IO/JsonReporter.php b/tools/chorale/src/IO/JsonReporter.php index 3cf816da..da00cc87 100644 --- a/tools/chorale/src/IO/JsonReporter.php +++ b/tools/chorale/src/IO/JsonReporter.php @@ -18,6 +18,7 @@ public function build(array $defaults, array $discoverySets, array $actions): st if ($json === false) { throw new \RuntimeException('Failed to encode JSON output.'); } + return $json . PHP_EOL; } } diff --git a/tools/chorale/src/Repo/RepoResolver.php b/tools/chorale/src/Repo/RepoResolver.php index 771dd7c1..cfa7c915 100644 --- a/tools/chorale/src/Repo/RepoResolver.php +++ b/tools/chorale/src/Repo/RepoResolver.php @@ -6,11 +6,11 @@ use Chorale\Util\PathUtilsInterface; -final class RepoResolver implements RepoResolverInterface +final readonly class RepoResolver implements RepoResolverInterface { public function __construct( - private readonly TemplateRendererInterface $renderer, - private readonly PathUtilsInterface $paths, + private TemplateRendererInterface $renderer, + private PathUtilsInterface $paths, ) {} public function resolve(array $defaults, array $pattern, array $target, string $path, ?string $name = null): string diff --git a/tools/chorale/src/Repo/TemplateRenderer.php b/tools/chorale/src/Repo/TemplateRenderer.php index 44f304c9..02f155d7 100644 --- a/tools/chorale/src/Repo/TemplateRenderer.php +++ b/tools/chorale/src/Repo/TemplateRenderer.php @@ -63,7 +63,7 @@ public function render(string $template, array $vars): string '/\{([a-zA-Z_]\w*)(?::([a-zA-Z:]+))?\}/', function (array $m) use ($vars): string { $var = $m[1]; - $filters = isset($m[2]) ? explode(':', (string) $m[2]) : []; + $filters = isset($m[2]) ? explode(':', $m[2]) : []; $value = (string) ($vars[$var] ?? ''); foreach ($filters as $f) { if ($f === '') { diff --git a/tools/chorale/src/Rules/ConflictDetector.php b/tools/chorale/src/Rules/ConflictDetector.php index fd6bb0d9..ca810385 100644 --- a/tools/chorale/src/Rules/ConflictDetector.php +++ b/tools/chorale/src/Rules/ConflictDetector.php @@ -6,10 +6,10 @@ use Chorale\Discovery\PatternMatcherInterface; -final class ConflictDetector implements ConflictDetectorInterface +final readonly class ConflictDetector implements ConflictDetectorInterface { public function __construct( - private readonly PatternMatcherInterface $matcher + private PatternMatcherInterface $matcher ) {} public function detect(array $patterns, string $path): array diff --git a/tools/chorale/src/Rules/RequiredFilesChecker.php b/tools/chorale/src/Rules/RequiredFilesChecker.php index 390a734c..3c4d3f90 100644 --- a/tools/chorale/src/Rules/RequiredFilesChecker.php +++ b/tools/chorale/src/Rules/RequiredFilesChecker.php @@ -18,6 +18,7 @@ public function missing(string $projectRoot, string $packagePath, array $require $miss[] = $rel; } } + return $miss; } } diff --git a/tools/chorale/src/Run/ComposerRootUpdateExecutor.php b/tools/chorale/src/Run/ComposerRootUpdateExecutor.php index d9a71537..61dd4113 100644 --- a/tools/chorale/src/Run/ComposerRootUpdateExecutor.php +++ b/tools/chorale/src/Run/ComposerRootUpdateExecutor.php @@ -30,6 +30,7 @@ public function execute(string $projectRoot, array $step): void if ($rootName === '') { throw new RuntimeException('Root package name missing.'); } + $data['name'] = $rootName; $rootVersion = $step['root_version'] ?? null; diff --git a/tools/chorale/src/Run/Runner.php b/tools/chorale/src/Run/Runner.php index 24db321c..fa2fecb0 100644 --- a/tools/chorale/src/Run/Runner.php +++ b/tools/chorale/src/Run/Runner.php @@ -9,12 +9,12 @@ use Chorale\Plan\PlanStepInterface; use RuntimeException; -final class Runner implements RunnerInterface +final readonly class Runner implements RunnerInterface { public function __construct( - private readonly ConfigLoaderInterface $configLoader, - private readonly PlanBuilderInterface $planner, - private readonly StepExecutorRegistry $executors, + private ConfigLoaderInterface $configLoader, + private PlanBuilderInterface $planner, + private StepExecutorRegistry $executors, ) {} public function plan(string $projectRoot, array $options = []): array diff --git a/tools/chorale/src/Telemetry/RunSummary.php b/tools/chorale/src/Telemetry/RunSummary.php index 1d210f55..61da6508 100644 --- a/tools/chorale/src/Telemetry/RunSummary.php +++ b/tools/chorale/src/Telemetry/RunSummary.php @@ -14,6 +14,7 @@ public function inc(string $bucket): void if ($bucket === '') { return; } + $this->buckets[$bucket] = ($this->buckets[$bucket] ?? 0) + 1; } diff --git a/tools/chorale/src/Tests/Composer/DependencyMergerTest.php b/tools/chorale/src/Tests/Composer/DependencyMergerTest.php index bbfdf3e2..6ae5a6e3 100644 --- a/tools/chorale/src/Tests/Composer/DependencyMergerTest.php +++ b/tools/chorale/src/Tests/Composer/DependencyMergerTest.php @@ -67,4 +67,3 @@ public function read(string $absolutePath): array $this->assertSame('non-caret-mixed', $result['conflicts'][0]['reason']); } } - diff --git a/tools/chorale/src/Tests/Run/PackageVersionUpdateExecutorTest.php b/tools/chorale/src/Tests/Run/PackageVersionUpdateExecutorTest.php index 76d4bd1e..35ef6964 100644 --- a/tools/chorale/src/Tests/Run/PackageVersionUpdateExecutorTest.php +++ b/tools/chorale/src/Tests/Run/PackageVersionUpdateExecutorTest.php @@ -20,7 +20,7 @@ final class PackageVersionUpdateExecutorTest extends TestCase public function testExecuteUpdatesComposerJson(): void { $projectRoot = sys_get_temp_dir() . '/chorale-exec-test-' . uniqid(); - mkdir($projectRoot . '/pkg', 0777, true); + mkdir($projectRoot . '/pkg', 0o777, true); file_put_contents($projectRoot . '/pkg/composer.json', json_encode(['name' => 'pkg/pkg'], JSON_PRETTY_PRINT)); $executor = new PackageVersionUpdateExecutor(); diff --git a/tools/chorale/src/Tests/Run/RunnerTest.php b/tools/chorale/src/Tests/Run/RunnerTest.php index c83557cb..215188e6 100644 --- a/tools/chorale/src/Tests/Run/RunnerTest.php +++ b/tools/chorale/src/Tests/Run/RunnerTest.php @@ -5,11 +5,11 @@ namespace Chorale\Tests\Run; use Chorale\Config\ConfigLoaderInterface; -use Chorale\Plan\PlanBuilderInterface; use Chorale\Plan\PackageVersionUpdateStep; +use Chorale\Plan\PlanBuilderInterface; +use Chorale\Run\PackageVersionUpdateExecutor; use Chorale\Run\Runner; use Chorale\Run\StepExecutorRegistry; -use Chorale\Run\PackageVersionUpdateExecutor; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; @@ -25,7 +25,7 @@ final class RunnerTest extends TestCase public function testRunAppliesPackageVersionUpdate(): void { $projectRoot = sys_get_temp_dir() . '/chorale-runner-test-' . uniqid(); - mkdir($projectRoot . '/pkg', 0777, true); + mkdir($projectRoot . '/pkg', 0o777, true); file_put_contents($projectRoot . '/pkg/composer.json', json_encode(['name' => 'pkg/pkg'], JSON_PRETTY_PRINT)); $configLoader = $this->createStub(ConfigLoaderInterface::class); diff --git a/tools/chorale/src/Tests/Run/StepExecutorRegistryTest.php b/tools/chorale/src/Tests/Run/StepExecutorRegistryTest.php index 117588a0..92018e86 100644 --- a/tools/chorale/src/Tests/Run/StepExecutorRegistryTest.php +++ b/tools/chorale/src/Tests/Run/StepExecutorRegistryTest.php @@ -23,8 +23,16 @@ public function testExecuteUsesMatchingExecutor(): void { $executor = new class implements StepExecutorInterface { public bool $called = false; - public function supports(array $step): bool { return $step['type'] === 'x'; } - public function execute(string $projectRoot, array $step): void { $this->called = true; } + + public function supports(array $step): bool + { + return $step['type'] === 'x'; + } + + public function execute(string $projectRoot, array $step): void + { + $this->called = true; + } }; $registry = new StepExecutorRegistry([$executor]); $registry->execute('/tmp', ['type' => 'x']); diff --git a/tools/chorale/src/Util/PathUtils.php b/tools/chorale/src/Util/PathUtils.php index 97c602dd..dacdcc1d 100644 --- a/tools/chorale/src/Util/PathUtils.php +++ b/tools/chorale/src/Util/PathUtils.php @@ -32,6 +32,7 @@ public function normalize(string $path): string if ($seg === '') { continue; } + if ($seg === '.') { continue; } diff --git a/tools/phpunit/bin/run b/tools/phpunit/bin/run new file mode 100755 index 00000000..7c95d2e7 --- /dev/null +++ b/tools/phpunit/bin/run @@ -0,0 +1,20 @@ +#!/usr/bin/env php +run($argv)); + diff --git a/tools/psalm/composer.json b/tools/psalm/composer.json index e70b3608..16bc7d10 100644 --- a/tools/psalm/composer.json +++ b/tools/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { - "vimeo/psalm": "^5", - "psalm/plugin-phpunit": "^0.18" + "vimeo/psalm": "^6", + "psalm/plugin-phpunit": "^0.19" }, "config": { "allow-plugins": {