ImmutableParameterBag::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/*
3
 * This file is part of the Borobudur-DependencyInjection package.
4
 *
5
 * (c) Hexacodelabs <http://hexacodelabs.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Borobudur\DependencyInjection\ParameterBag;
12
13
use Borobudur\DependencyInjection\Exception\ImmutableParameterException;
14
use Borobudur\DependencyInjection\ParameterBag;
15
16
/**
17
 * @author      Iqbal Maulana <[email protected]>
18
 * @created     8/8/15
19
 */
20
class ImmutableParameterBag extends ParameterBag
21
{
22
    /**
23
     * Constructor.
24
     *
25
     * @param array $parameters
26
     */
27
    public function __construct(array $parameters = array())
28
    {
29
        $this->parameters = $parameters;
30
31
        parent::__construct(array(), new Resolver($this, true));
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function replace(array $parameters)
38
    {
39
        throw new ImmutableParameterException('replace');
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function add(array $parameters)
46
    {
47
        throw new ImmutableParameterException('add');
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function set($name, $value)
54
    {
55
        throw new ImmutableParameterException('set');
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function remove($name)
62
    {
63
        throw new ImmutableParameterException('remove');
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function clear()
70
    {
71
        throw new ImmutableParameterException('clear');
72
    }
73
}
74