| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 4 | public function provideName(FileInfo $srcFileInfo) |
|
| 18 | { |
||
| 19 | 4 | if (!$srcFileInfo->isFile()) { |
|
| 20 | 1 | throw new \InvalidArgumentException(sprintf( |
|
| 21 | 1 | 'The source file does not exist on "%s" specified path.', |
|
| 22 | 1 | $srcFileInfo->toString() |
|
| 23 | 1 | )); |
|
| 24 | } |
||
| 25 | 3 | $hash = hash_file($this->algorithm, $srcFileInfo->toString()); |
|
| 26 | |||
| 27 | 3 | $dstFileInfo = $this->provideNameByHash($srcFileInfo, $hash); |
|
| 28 | |||
| 29 | 3 | return $dstFileInfo; |
|
| 30 | } |
||
| 31 | } |
||
| 32 |