Skip to content

Commit 6a20779

Browse files
minor #59277 [Security] Sync Security\ExpressionLanguage constructor with parent (kor3k)
This PR was merged into the 7.3 branch. Discussion ---------- [Security] Sync Security\ExpressionLanguage constructor with parent | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? |no | Issues | - | License | MIT change typehint array -> iterable in `\Symfony\Component\Security\Core\Authorization\ExpressionLanguage::__construct` Commits ------- e9a26fc8f4e Sync Security\ExpressionLanguage constructor with parent
2 parents c3ad427 + fc11cec commit 6a20779

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ExpressionLanguage.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727
*/
2828
class ExpressionLanguage extends BaseExpressionLanguage
2929
{
30-
public function __construct(?CacheItemPoolInterface $cache = null, array $providers = [], ?callable $serviceCompiler = null, ?\Closure $getEnv = null)
30+
public function __construct(?CacheItemPoolInterface $cache = null, iterable $providers = [], ?callable $serviceCompiler = null, ?\Closure $getEnv = null)
3131
{
32+
if (!\is_array($providers)) {
33+
$providers = iterator_to_array($providers, false);
34+
}
35+
3236
// prepend the default provider to let users override it easily
3337
array_unshift($providers, new ExpressionLanguageProvider($serviceCompiler, $getEnv));
3438

0 commit comments

Comments
 (0)