Completed
Push — master ( 1630de...8c3d6c )
by Mikael
02:12
created

AppInjectableTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 22
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setApp() 0 5 1
1
<?php
2
3
namespace Anax\Commons;
4
5
use Psr\Container\ContainerInterface;
6
7
/**
8
 * Trait to implement the AppInjectableInterface that allows a class
9
 * to be injected with $app.
10
 */
11
trait AppInjectableTrait
12
{
13
    /**
14
     * @var ContainerInterface $app the dependency/service container.
15
     */
16
    protected $app;
17
18
19
20
    /**
21
     * Set the dependency/service container to use.
22
     *
23
     * @param ContainerInterface $app a dependency/service container
24
     *
25
     * @return self
26
     */
27
    public function setApp(ContainerInterface $app)
28
    {
29
        $this->app = $app;
30
        return $this;
31
    }
32
}
33