Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | 2 | public function provideName(FileInfo $srcFileInfo) |
|
18 | { |
||
19 | 2 | 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 | 1 | $hash = hash_file($this->algorithm, $srcFileInfo->toString()); |
|
26 | |||
27 | 1 | $dstFileInfo = $this->provideNameByHash($srcFileInfo, $hash); |
|
28 | |||
29 | 1 | return $dstFileInfo; |
|
30 | } |
||
31 | } |
||
32 |