Completed
Push — master ( 26c2c8...36ff73 )
by Mikael
07:20
created

AppInjectableTrait::setApp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Anax\Common;
4
5
/**
6
 * Trait implementing AppInjectableInterface for classes which need to
7
 * be injectad with the $app.
8
 */
9
trait AppInjectableTrait
10
{
11
    /**
12
     * Properties
13
     *
14
     */
15
    private $app;  // Contains all framework resources.
16
17
18
19
    /**
20
     * Inject the $app into this class.
21
     *
22
     * @param object $app containing framework resources.
23
     *
24
     * @return $this for chaining.
25
     */
26 1
    public function setApp($app)
27
    {
28 1
        $this->app = $app;
29 1
        return $this;
30
    }
31
}
32