Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 1 | public function get(): array |
|
21 | { |
||
22 | 1 | $useStatements = []; |
|
23 | |||
24 | 1 | foreach ($this->readModel($this->model) as $line) { |
|
25 | 1 | if (strpos($line, 'class') === 0) { |
|
26 | 1 | break; |
|
27 | 1 | } elseif (strpos($line, 'use') === 0) { |
|
28 | 1 | preg_match('/([\w\\\_]+)(?:\s+as\s+([\w_]+))?;/i', $line, $matches); |
|
29 | |||
30 | 1 | $segments = explode('\\', $matches[1]); |
|
31 | 1 | $alias = $matches[2] ?? end($segments); |
|
32 | 1 | $useStatements[$alias] = $matches[1]; |
|
33 | } |
||
34 | } |
||
35 | |||
36 | 1 | return $useStatements; |
|
37 | } |
||
39 |