diff --git a/composer.json b/composer.json index b4f1c76..d7644d2 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "mikey179/vfsstream": "^1.6.11", "phpunit/phpunit": "^9.5.26", "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^4.29.0", + "vimeo/psalm": "^5.0.0", "webmozart/assert": "^1.11.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index 0fabd56..a8c69c9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a7f2cfe82820ba885f3251bf221f3eb2", + "content-hash": "7982e9686f57d6df8eaf4fec43fdb58a", "packages": [], "packages-dev": [ { @@ -4777,24 +4777,24 @@ }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "4defa177c89397c5e14737a80fe4896584130674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4defa177c89397c5e14737a80fe4896584130674", + "reference": "4defa177c89397c5e14737a80fe4896584130674", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer/package-versions-deprecated": "^1.10.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -4803,35 +4803,34 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", + "felixfbecker/advanced-json-rpc": "^3.1", + "felixfbecker/language-server-protocol": "^1.5.2", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpstan/phpdoc-parser": "1.2.* || 1.6.4", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -4847,17 +4846,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -4879,9 +4875,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" + "source": "https://github.com/vimeo/psalm/tree/5.1.0" }, - "time": "2022-11-06T20:37:08+00:00" + "time": "2022-12-02T01:23:35+00:00" }, { "name": "webimpress/coding-standard", @@ -4995,57 +4991,6 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], diff --git a/src/Collection.php b/src/Collection.php index f971814..7ae3b04 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -27,6 +27,8 @@ * * @template TKey of array-key * @template TValue + * + * @implements IteratorAggregate */ final class Collection implements Countable, diff --git a/src/ComponentInstaller.php b/src/ComponentInstaller.php index 7ae57a4..bf22f72 100644 --- a/src/ComponentInstaller.php +++ b/src/ComponentInstaller.php @@ -478,7 +478,7 @@ private function marshalPackageComponents(array $extra, Collection $packageTypes * * @param ComposerExtraComponentInstallerArrayType $extra * @param Collection $options - * @return Collection List of packages to install + * @return Collection List of packages to install */ private function marshalInstallableComponents(array $extra, Collection $options): Collection { @@ -658,9 +658,10 @@ private function removePackageFromConfig(string $package, array $metadata): void /** * Remove an individual module defined in a package from configuration. * - * @param non-empty-string $component Module to remove + * @template TKey of array-key + * @param non-empty-string $component Module to remove * @param non-empty-string $package Package in which module is defined - * @param Collection $injectors Injectors to use for removal + * @param Collection $injectors Injectors to use for removal */ private function removeModuleFromConfig(string $component, string $package, Collection $injectors): void { diff --git a/src/ConfigDiscovery.php b/src/ConfigDiscovery.php index ed01b6e..6a03099 100644 --- a/src/ConfigDiscovery.php +++ b/src/ConfigDiscovery.php @@ -49,7 +49,8 @@ final class ConfigDiscovery /** * Return a list of available configuration options. * - * @param Collection $availableTypes Collection of injector type + * @template TKey of array-key + * @param Collection $availableTypes Collection of injector type * constants indicating valid package types that could be injected. * @param string $projectRoot Path to the project root; assumes PWD by default. * @return Collection Collection of ConfigOption instances. diff --git a/src/ConfigDiscovery/DiscoveryChain.php b/src/ConfigDiscovery/DiscoveryChain.php index 82e14ae..4b1084b 100644 --- a/src/ConfigDiscovery/DiscoveryChain.php +++ b/src/ConfigDiscovery/DiscoveryChain.php @@ -14,7 +14,7 @@ final class DiscoveryChain implements DiscoveryChainInterface /** * Discovery Collection * - * @var Collection + * @var Collection */ protected Collection $chain; @@ -27,7 +27,7 @@ final class DiscoveryChain implements DiscoveryChainInterface public function __construct(array $discovery, string $projectDirectory = '') { $this->chain = (new Collection($discovery)) - // Create a discovery class for the dicovery type + // Create a discovery class for the discovery type ->map(static fn(string $discoveryClass) => new $discoveryClass($projectDirectory)) // Use only those where we can locate a corresponding config file ->filter(static fn(DiscoveryInterface $discovery) => $discovery->locate()); diff --git a/src/Injector/ConfigInjectorChain.php b/src/Injector/ConfigInjectorChain.php index 76b10f2..34dcf21 100644 --- a/src/Injector/ConfigInjectorChain.php +++ b/src/Injector/ConfigInjectorChain.php @@ -22,7 +22,7 @@ final class ConfigInjectorChain implements InjectorInterface /** * ConfigInjectors Collection * - * @var Collection + * @var Collection */ private Collection $chain; @@ -135,7 +135,7 @@ public function remove(string $package): bool } /** - * @return Collection + * @return Collection */ public function getCollection(): Collection {