1 | <?php |
||
23 | class Prefix implements Trimmer |
||
24 | { |
||
25 | /** |
||
26 | * Trims the common prefix from an array of strings |
||
27 | * |
||
28 | * @param array $scripts The list of scripts |
||
29 | * |
||
30 | * @return array The trimmed strings |
||
31 | */ |
||
32 | 7 | public function trim(array $scripts) |
|
42 | |||
43 | /** |
||
44 | * Gets the length of the common prefix to trim |
||
45 | * |
||
46 | * @param array $scripts The list of scripts |
||
47 | * |
||
48 | * @return int The length of the common prefix |
||
49 | */ |
||
50 | 7 | private function getPrefixLength(array $scripts) |
|
68 | |||
69 | /** |
||
70 | * Get the longest common prefix between two strings |
||
71 | * |
||
72 | * @param string $prefix The current common prefix |
||
73 | * @param string $path The path to match against the common prefix |
||
74 | * |
||
75 | * @return string The common prefix |
||
76 | */ |
||
77 | 6 | private function findLongestPrefix($prefix, $path) |
|
94 | } |
||
95 |