VOClosure   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1
ccs 5
cts 7
cp 0.7143
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
A fromClosure() 0 4 1
1
<?php
2
3
namespace BestServedCold\PhalueObjects;
4
5
/**
6
 * Class VOClosure
7
 *
8
 * @package BestServedCold\PhalueObjects\ValueObject
9
 */
10
class VOClosure extends ValueObject
11
{
12
    /**
13
     * VOClosure constructor.
14
     *
15
     * @param \Closure $value
16
     */
17 6
    public function __construct(\Closure $value)
18
    {
19 6
        parent::__construct($value);
20 6
    }
21
22
    /**
23
     * @return \Closure
24
     */
25 6
    public function getValue()
26
    {
27 6
        return parent::getValue();
28
    }
29
30
    /**
31
     * @param  \Closure $closure
32
     * @return static
33
     */
34
    public static function fromClosure(\Closure $closure)
35
    {
36
        return new static($closure);
37
    }
38
}
39