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

ResourceValue::doHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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