Parameter::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Interop\Container\Factories;
4
5
/**
6
 * A factory that creates a container entry that is actually just a parameter/constant.
7
 */
8
final class Parameter
9
{
10
    private $value;
11
12
    /**
13
     * Creates a parameter.
14
     *
15
     * @param scalar|array $value The value of the parameter. This should be a scalar or an array of scalar values
16
     */
17
    public function __construct($value)
18
    {
19
        $this->value = $value;
20
    }
21
22
    /**
23
     * Returns the value of the parameter.
24
     *
25
     * @return scalar|array
26
     */
27
    public function getValue()
28
    {
29
        return $this->value;
30
    }
31
32
    /**
33
     * Returns the value of the parameter.
34
     *
35
     * @return scalar|array
36
     */
37
    public function __invoke()
38
    {
39
        return $this->value;
40
    }
41
}
42