| Conditions | 5 | 
| Paths | 4 | 
| Total Lines | 17 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 19 | public static function getClosestDirForFile($path, $fileName) | ||
| 20 |     { | ||
| 21 |         while (true) { | ||
| 22 |             if (\is_dir($path) && \file_exists(PathUtils::composePath($path, $fileName))) { | ||
| 23 | return $path; | ||
| 24 | } | ||
| 25 | |||
| 26 | $parent = \dirname($path); | ||
| 27 | |||
| 28 |             if ($parent === $path) { | ||
| 29 | break; | ||
| 30 | } | ||
| 31 | |||
| 32 | $path = $parent; | ||
| 33 | } | ||
| 34 | |||
| 35 | return false; | ||
| 36 | } | ||
| 59 |