Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
15 | public function execute(string $filePath): array |
||
16 | { |
||
17 | if (!file_exists($filePath)) { |
||
18 | return []; |
||
19 | } |
||
20 | |||
21 | $content = file_get_contents($filePath); |
||
22 | $tokens = token_get_all($content); |
||
23 | |||
24 | $stringTokens = []; |
||
25 | foreach ($tokens as $token) { |
||
26 | if (is_array($token) && $token[0] === T_STRING) { |
||
27 | $stringTokens[] = $token[1]; |
||
28 | } |
||
29 | } |
||
30 | return $stringTokens; |
||
31 | } |
||
33 |