DriverAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDriver() 0 5 1
A getDriver() 0 4 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Storage
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Storage\Traits;
16
17
use Phossa2\Storage\Interfaces\DriverInterface;
18
use Phossa2\Storage\Interfaces\DriverAwareInterface;
19
20
/**
21
 * DriverAwareTrait
22
 *
23
 * Implementation of DriverAwareInterface
24
 *
25
 * @package Phossa2\Storage
26
 * @author  Hong Zhang <[email protected]>
27
 * @see     DriverAwareInterface
28
 * @version 2.0.0
29
 * @since   2.0.0 added
30
 */
31
trait DriverAwareTrait
32
{
33
    /**
34
     * @var    DriverInterface
35
     * @access protected
36
     */
37
    protected $driver;
38
39
    /**
40
     * {@inheritDoc}
41
     */
42
    public function setDriver(DriverInterface $driver)
43
    {
44
        $this->driver = $driver;
45
        return $this;
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     */
51
    public function getDriver()/*# : DriverInterface */
52
    {
53
        return $this->driver;
54
    }
55
}
56