Skip to content

Commit 57ff35e

Browse files
committed
feature #42471 Add generic types to traversable implementations (derrabus)
This PR was merged into the 5.4 branch. Discussion ---------- Add generic types to traversable implementations | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | kinda | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Since tool support for generic types is growing, I wanted to give it a try and add generics to our traversable implementations. This should help Psalm to understand our code better. Furthermore, it helps app developers with running static code analysis on their own codebases. Marking this as WIP for now until I reviewed all errors reported by Psalm. Commits ------- 7f824fcf95 Add generic types to traversable implementations
2 parents f278b8b + 6f9d9a5 commit 57ff35e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Authentication/AuthenticationProviderManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class AuthenticationProviderManager implements AuthenticationManagerInterface
4747
private $eventDispatcher;
4848

4949
/**
50-
* @param iterable|AuthenticationProviderInterface[] $providers An iterable with AuthenticationProviderInterface instances as values
51-
* @param bool $eraseCredentials Whether to erase credentials after authentication or not
50+
* @param iterable<int, AuthenticationProviderInterface> $providers An iterable with AuthenticationProviderInterface instances as values
51+
* @param bool $eraseCredentials Whether to erase credentials after authentication or not
5252
*
5353
* @throws \InvalidArgumentException
5454
*/

Authorization/TraceableAccessDecisionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getStrategy(): string
9898
}
9999

100100
/**
101-
* @return iterable|VoterInterface[]
101+
* @return iterable<int, VoterInterface>
102102
*/
103103
public function getVoters(): iterable
104104
{

User/ChainUserProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class ChainUserProvider implements UserProviderInterface, PasswordUpgraderInterf
2727
private $providers;
2828

2929
/**
30-
* @param iterable|UserProviderInterface[] $providers
30+
* @param iterable<int, UserProviderInterface> $providers
3131
*/
3232
public function __construct(iterable $providers)
3333
{
3434
$this->providers = $providers;
3535
}
3636

3737
/**
38-
* @return array
38+
* @return UserProviderInterface[]
3939
*/
4040
public function getProviders()
4141
{

0 commit comments

Comments
 (0)