8000 Merge branch '2.7' into 2.8 · symfony/security-core@c349d6e · GitHub
[go: up one dir, main page]

Skip to content

Commit c349d6e

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [travis/appveyor] Wire simple-phpunit [Console] fixed PHP7 Errors are now handled and converted to Exceptions Fix #19721 bumped Symfony version to 2.7.19 updated VERSION for 2.7.18 update CONTRIBUTORS for 2.7.18 updated CHANGELOG for 2.7.18 [Security] Optimize RoleHierarchy's buildRoleMap method
2 parents 21c82ef + d95becf commit c349d6e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Role/RoleHierarchy.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,17 @@ protected function buildRoleMap()
6565
}
6666

6767
$visited[] = $role;
68-
$this->map[$main] = array_unique(array_merge($this->map[$main], $this->hierarchy[$role]));
69-
$additionalRoles = array_merge($additionalRoles, array_diff($this->< 82F3 span class=pl-c1>hierarchy[$role], $visited));
68+
69+
foreach ($this->hierarchy[$role] as $roleToAdd) {
70+
$this->map[$main][] = $roleToAdd;
71+
}
72+
73+
foreach (array_diff($this->hierarchy[$role], $visited) as $additionalRole) {
74+
$additionalRoles[] = $additionalRole;
75+
}
7076
}
77+
78+
$this->map[$main] = array_unique($this->map[$main]);
7179
}
7280
}
7381
}

0 commit comments

Comments
 (0)
0