HashNamingStrategy   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A provideName() 0 9 1
1
<?php
2
3
namespace FileNamingResolver\NamingStrategy;
4
5
use FileNamingResolver\FileInfo;
6
7
/**
8
 * @author Victor Bocharsky <[email protected]>
9
 */
10
class HashNamingStrategy extends AbstractHashNamingStrategy
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 3
    public function provideName(FileInfo $srcFileInfo)
16
    {
17 3
        $string = $this->generateUniqueString();
18 3
        $hash = hash($this->algorithm, $string);
19
20 3
        $dstFileInfo = $this->provideNameByHash($srcFileInfo, $hash);
21
22 3
        return $dstFileInfo;
23
    }
24
}
25