Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
42 | private function cleanBuild($file) |
||
43 | { |
||
44 | // TODO Temp rough build cleaner |
||
45 | $baseName = basename($file, '.php'); |
||
46 | $basePath = sprintf( |
||
47 | '%s/%s@addendum', |
||
48 | dirname($this->basePath), |
||
49 | Cacher::classToFile(Builder::class) |
||
50 | ); |
||
51 | foreach(new DirectoryIterator($basePath) as $info) |
||
52 | { |
||
53 | if(!$info->isFile()) |
||
54 | { |
||
55 | continue; |
||
56 | } |
||
57 | $name = $info->getFilename(); |
||
58 | // NOTE: Coarse check, might remove more files |
||
59 | if(strpos($name, $baseName) !== false) |
||
60 | { |
||
61 | unlink($info->getPathname()); |
||
62 | } |
||
63 | } |
||
64 | } |
||
65 | } |