Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
33 | 3 | public function detectDottedFromFilePaths(array $sniffFilePaths) |
|
34 | { |
||
35 | 3 | $dottedNames = []; |
|
36 | 3 | foreach ($sniffFilePaths as $sniffFilePath) { |
|
37 | 3 | $sniffFilePathParts = explode(DIRECTORY_SEPARATOR, $sniffFilePath); |
|
38 | 3 | $sniffFilePathParts = array_slice($sniffFilePathParts, -4); |
|
39 | |||
40 | 3 | unset($sniffFilePathParts[1]); // drop "/Sniffs" |
|
41 | 3 | $sniffFilePathParts[3] = substr($sniffFilePathParts[3], 0, -9); // drop "Sniff.php" |
|
42 | |||
43 | 3 | $dottedName = implode($sniffFilePathParts, '.'); |
|
44 | |||
45 | 3 | $dottedNames[$dottedName] = $sniffFilePath; |
|
46 | } |
||
47 | |||
48 | 3 | return $dottedNames; |
|
49 | } |
||
50 | } |
||
51 |