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

ClosureObject   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hash() 0 6 1
A __invoke() 0 4 1
1
<?php
2
3
namespace drupol\valuewrapper\Object;
4
5
use SuperClosure\Serializer;
6
7
/**
8
 * Class ClosureObject
9
 */
10
class ClosureObject extends ObjectValue
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 1
    public function hash(): string
16
    {
17 1
        $serializer = new Serializer();
18
19 1
        return $this->doHash($serializer->serialize($this->value));
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function __invoke()
26
    {
27 1
        return \call_user_func_array($this->value, \func_get_args());
28
    }
29
}
30