AbstractStorage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of Transfer.
5
 *
6
 * For the full copyright and license information, please view the LICENSE file located
7
 * in the root directory.
8
 */
9
10
namespace Transfer\Storage;
11
12
use Transfer\Storage\Hashing\HashingStrategyInterface;
13
use Transfer\Storage\Hashing\StandardHashingStrategy;
14
15
/**
16
 * Abstract storage.
17
 */
18
abstract class AbstractStorage implements StorageInterface
19
{
20
    /**
21
     * @var HashingStrategyInterface Hashing strategy
22
     */
23
    protected $hashingStrategy;
24
25
    /**
26
     * @param HashingStrategyInterface|null $hashingStrategy Hashing strategy
27
     */
28 24
    public function __construct(HashingStrategyInterface $hashingStrategy = null)
29
    {
30 24
        $this->hashingStrategy = $hashingStrategy;
31
32 24
        if ($this->hashingStrategy === null) {
33 24
            $this->hashingStrategy = new StandardHashingStrategy();
34 24
        }
35 24
    }
36
}
37