Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency vimeo/psalm to v5, improved type declarations in internal collection objects #64

Merged
merged 2 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
113 changes: 29 additions & 84 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*
* @template TKey of array-key
* @template TValue
*
* @implements IteratorAggregate<TKey, TValue>
*/
final class Collection implements
Countable,
Expand Down
7 changes: 4 additions & 3 deletions src/ComponentInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ private function marshalPackageComponents(array $extra, Collection $packageTypes
*
* @param ComposerExtraComponentInstallerArrayType $extra
* @param Collection<int,ConfigOption> $options
* @return Collection<array-key,non-empty-string> List of packages to install
* @return Collection<int,non-empty-string> List of packages to install
*/
private function marshalInstallableComponents(array $extra, Collection $options): Collection
{
Expand Down Expand Up @@ -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<array-key,InjectorInterface> $injectors Injectors to use for removal
* @param Collection<TKey,InjectorInterface> $injectors Injectors to use for removal
*/
private function removeModuleFromConfig(string $component, string $package, Collection $injectors): void
{
Expand Down
3 changes: 2 additions & 1 deletion src/ConfigDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ final class ConfigDiscovery
/**
* Return a list of available configuration options.
*
* @param Collection<array-key,InjectorInterface::TYPE_*> $availableTypes Collection of injector type
* @template TKey of array-key
* @param Collection<TKey,InjectorInterface::TYPE_*> $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<int,ConfigOption> Collection of ConfigOption instances.
Expand Down
4 changes: 2 additions & 2 deletions src/ConfigDiscovery/DiscoveryChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class DiscoveryChain implements DiscoveryChainInterface
/**
* Discovery Collection
*
* @var Collection<array-key,DiscoveryInterface>
* @var Collection<string,DiscoveryInterface>
*/
protected Collection $chain;

Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/Injector/ConfigInjectorChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class ConfigInjectorChain implements InjectorInterface
/**
* ConfigInjectors Collection
*
* @var Collection<array-key,InjectorInterface>
* @var Collection<string,InjectorInterface>
*/
private Collection $chain;

Expand Down Expand Up @@ -135,7 +135,7 @@ public function remove(string $package): bool
}

/**
* @return Collection<array-key,InjectorInterface>
* @return Collection<string,InjectorInterface>
*/
public function getCollection(): Collection
{
Expand Down