| Conditions | 4 | 
| Paths | 3 | 
| Total Lines | 22 | 
| Code Lines | 16 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 18 | 
| CRAP Score | 4 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 1 | 
| 1 | <?php  | 
            ||
| 70 | 3 | protected function createDir($fileName)  | 
            |
| 71 |     { | 
            ||
| 72 | 3 | $dir = $fileName;  | 
            |
| 73 | 3 | $createdDirs = array();  | 
            |
| 74 |         do { | 
            ||
| 75 | 3 | $dir = dirname($dir);  | 
            |
| 76 | 3 | $createdDirs[] = $dir;  | 
            |
| 77 | 3 | } while (! file_exists($dir));  | 
            |
| 78 | 3 | array_pop($createdDirs);  | 
            |
| 79 | 3 | $this->createdDirs = array_reverse($createdDirs);  | 
            |
| 80 | |||
| 81 | 3 | $targetdir = dirname($fileName);  | 
            |
| 82 | 3 |         if (!file_exists($targetdir)) { | 
            |
| 83 | 2 | $created = mkdir($targetdir, 0766, true);  | 
            |
| 84 | 2 |             if (!$created) { | 
            |
| 85 | 1 | $this->success = false;  | 
            |
| 86 | 1 | throw new Downloader\TransportException(  | 
            |
| 87 | 1 | "The file could not be written to $this->fileName."  | 
            |
| 88 | 1 | );  | 
            |
| 89 | }  | 
            ||
| 90 | 1 | }  | 
            |
| 91 | 2 | }  | 
            |
| 92 | }  | 
            ||
| 93 |