File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 14
14
use Symfony \Component \DependencyInjection \Reference ;
15
15
use Symfony \Component \DependencyInjection \ContainerBuilder ;
16
16
use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
17
+ use Symfony \Component \DependencyInjection \Exception \LogicException ;
17
18
18
19
/**
19
20
* Adds all configured security voters to the access decision manager.
@@ -40,6 +41,10 @@ public function process(ContainerBuilder $container)
40
41
$ voters = iterator_to_array ($ voters );
41
42
ksort ($ voters );
42
43
43
- $ container ->getDefinition ('security.access.decision_manager ' )->replaceArgument (0 , array_values ($ voters ));
44
+ if (!$ voters ) {
45
+ throw new LogicException ('No security voters found. You need to tag at least one with "security.voter" ' );
46
+ }
47
+
48
+ $ container ->getDefinition ('security.access.decision_manager ' )->addMethodCall ('setVoters ' , array (array_values ($ voters )));
44
49
}
45
50
}
Original file line number Diff line number Diff line change 17
17
],
18
18
"require" : {
19
19
"php" : " >=5.3.9" ,
20
- "symfony/security" : " ~2.7 |~3.0.0" ,
20
+ "symfony/security" : " ~2.8 |~3.0.0" ,
21
21
"symfony/http-kernel" : " ~2.2|~3.0.0"
22
22
},
23
23
"require-dev" : {
You can’t perform that action at this time.
0 commit comments