| Conditions | 5 |
| Paths | 9 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function __construct(array $schema) |
||
| 17 | { |
||
| 18 | foreach ($schema as $key => $value) { |
||
| 19 | $role = $key; |
||
| 20 | |||
| 21 | if (\class_exists($role)) { |
||
| 22 | $role = $value[SchemaInterface::ROLE] ?? 'undefinedRole'; |
||
| 23 | } |
||
| 24 | |||
| 25 | $this->aliases[$key] = $role; |
||
| 26 | } |
||
| 27 | |||
| 28 | foreach ($this->aliases as $key => $role) { |
||
| 29 | if (\preg_match('/[^_a-zA-Z0-9]/u', $role)) { |
||
| 30 | $role = $this->makeAlias($role); |
||
| 31 | $this->aliases[$key] = $role; |
||
| 32 | } |
||
| 60 |