Skip to content

Commit c83ae6d

Browse files
kor3knicolas-grekas
authored andcommitted
Sync Security\ExpressionLanguage constructor with parent
change typehint array -> iterable
1 parent 9a04c4c commit c83ae6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Authorization/ExpressionLanguage.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ class_exists(ExpressionLanguageProvider::class);
2929
*/
3030
class ExpressionLanguage extends BaseExpressionLanguage
3131
{
32-
public function __construct(?CacheItemPoolInterface $cache = null, array $providers = [])
32+
public function __construct(?CacheItemPoolInterface $cache = null, iterable $providers = [])
3333
{
34+
if (!\is_array($providers)) {
35+
$providers = iterator_to_array($providers, false);
36+
}
37+
3438
// prepend the default provider to let users override it easily
3539
array_unshift($providers, new ExpressionLanguageProvider());
3640

0 commit comments

Comments
 (0)