Completed
Push — develop ( 90d90f...48c4f2 )
by Neomerx
06:19 queued 04:30
created

ContextStorage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getContainer() 0 4 1
1
<?php namespace Limoncello\Flute\Validation\Execution;
2
3
/**
4
 * Copyright 2015-2017 [email protected]
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
use Limoncello\Container\Traits\HasContainerTrait;
20
use Limoncello\Flute\Contracts\Validation\ContextStorageInterface;
21
use Limoncello\Validation\Execution\ContextStorage as BaseContextStorage;
22
use Psr\Container\ContainerInterface;
23
24
/**
25
 * @package Limoncello\Flute
26
 */
27
class ContextStorage extends BaseContextStorage implements ContextStorageInterface
28
{
29
    use HasContainerTrait {
30
        getContainer as public;
31
    }
32
33
    /**
34
     * @param ContainerInterface $container
35
     * @param array              $blocks
36
     */
37 9
    public function __construct(ContainerInterface $container, array $blocks)
38
    {
39 9
        parent::__construct($blocks);
40
41 9
        $this->setContainer($container);
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function getContainer(): ContainerInterface
48
    {
49
        return $this->container;
50
    }
51
}
52