FixedValueRecipe   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getValue() 0 3 1
A resolve() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lit\Air\Recipe;
6
7
use Lit\Air\Psr\Container;
8
9
/**
10
 * Always return a fixed value. Useful for test, and as a wrapper of arbitary value.
11
 */
12
class FixedValueRecipe extends AbstractRecipe
13
{
14
    protected $value;
15
16 8
    public function __construct($value)
17
    {
18 8
        $this->value = $value;
19 8
    }
20
21 8
    public function resolve(Container $container)
22
    {
23 8
        return $this->value;
24
    }
25
26
    /**
27
     * @return mixed
28
     */
29 2
    public function getValue()
30
    {
31 2
        return $this->value;
32
    }
33
}
34