Completed
Push — master ( 461219...630231 )
by Harry
04:03
created

BuilderTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setBuilder() 0 6 1
A getBuilder() 0 8 2
1
<?php
2
/**
3
 * This file is part of graze/data-file
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/data-file/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/data-file
12
 */
13
14
namespace Graze\DataFile\Helper\Builder;
15
16
trait BuilderTrait
17
{
18
    /**
19
     * @var BuilderInterface
20
     */
21
    protected $builder;
22
23
    /**
24
     * @param BuilderInterface $builder
25
     *
26
     * @return $this
27
     */
28 81
    public function setBuilder(BuilderInterface $builder)
29
    {
30 81
        $this->builder = $builder;
31
32 81
        return $this;
33
    }
34
35
    /**
36
     * @return BuilderInterface
37
     */
38 73
    public function getBuilder()
39
    {
40 73
        if (!$this->builder) {
41 19
            $this->builder = new Builder();
42
        }
43
44 73
        return $this->builder;
45
    }
46
}
47