ContainerSetter::setContainer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Caridea
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
 * use this file except in compliance with the License. You may obtain a copy of
7
 * the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
 * License for the specific language governing permissions and limitations under
15
 * the License.
16
 *
17
 * @copyright 2015-2018 LibreWorks contributors
18
 * @license   Apache-2.0
19
 */
20
namespace Caridea\Container;
21
22
/**
23
 * Allows objects to be made aware of the container that created them.
24
 */
25
trait ContainerSetter
26
{
27
    /**
28
     * @var \Caridea\Container\Container
29
     */
30
    protected $container;
31
32
    /**
33
     * Sets the container.
34
     *
35
     * @param \Caridea\Container\Container $container The container to set
36
     */
37 1
    public function setContainer(Container $container)
38
    {
39 1
        $this->container = $container;
40 1
    }
41
}
42