Completed
Push — master ( e238c3...0855a3 )
by Pol
13:48 queued 01:17
created

ResourceValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hash() 0 4 1
A doHash() 0 4 1
1
<?php
2
3
namespace drupol\valuewrapper\Resource;
4
5
use drupol\valuewrapper\AbstractValue;
6
7
class ResourceValue extends AbstractValue
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function hash(): string
13
    {
14
        return $this->doHash(\spl_object_hash($this->value));
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    protected function doHash(string $string) : string
21
    {
22
        return \sha1(gettype($this->value) . get_class($this->value) . $string);
23
    }
24
}
25