Skip to content

Commit fc11cec

Browse files
kor3knicolas-grekas
authored andcommitted
Sync Security\ExpressionLanguage constructor with parent
change typehint array -> iterable
1 parent 09a04f7 commit fc11cec

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)