File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/Symfony/Component/Security/Core/Dumper Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Security \Core \Dumper ;
13
13
14
+ use Symfony \Component \Security \Core \Role \RoleHierarchy ;
14
15
use Symfony \Component \Security \Core \Role \RoleHierarchyInterface ;
15
16
16
17
/**
@@ -56,7 +57,11 @@ public function dump(RoleHierarchyInterface $roleHierarchy): string
56
57
57
58
private function extractHierarchy (RoleHierarchyInterface $ roleHierarchy ): array
58
59
{
59
- $ reflection = new \ReflectionClass ($ roleHierarchy );
60
+ if (!$ roleHierarchy instanceof RoleHierarchy) {
61
+ return [];
62
+ }
63
+
64
+ $ reflection = new \ReflectionClass (RoleHierarchy::class);
60
65
61
66
if ($ reflection ->hasProperty ('hierarchy ' )) {
62
67
$ hierarchyProperty = $ reflection ->getProperty ('hierarchy ' );
You can’t perform that action at this time.
0 commit comments