FixedValueRecipe::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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