Parameter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
A __invoke() 0 4 1
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