Completed
Push — master ( 439406...4b2726 )
by Hong
03:09
created

BuilderAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setBuilder() 0 5 1
A getBuilder() 0 4 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Query
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\Query\Traits;
16
17
use Phossa2\Query\Interfaces\BuilderInterface;
18
use Phossa2\Query\Interfaces\BuilderAwareInterface;
19
20
/**
21
 * BuilderAwareTrait
22
 *
23
 * @package Phossa2\Query
24
 * @author  Hong Zhang <[email protected]>
25
 * @see     BuilderAwareInterface
26
 * @version 2.0.0
27
 * @since   2.0.0 added
28
 */
29
trait BuilderAwareTrait
30
{
31
    /**
32
     * @var    BuilderInterface
33
     * @access protected
34
     */
35
    protected $builder;
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    public function setBuilder(BuilderInterface $builder)
41
    {
42
        $this->builder = $builder;
43
        return $this;
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    public function getBuilder()/*# : BuilderInterface */
50
    {
51
        return $this->builder;
52
    }
53
}
54