Completed
Push — master ( 4ce755...511437 )
by Vitaly
02:11
created

CodeTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A defLine() 0 6 1
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 04.09.16 at 10:13
5
 */
6
namespace samsonphp\generator;
7
8
/**
9
 * Trait for generators that can generate internal code.
10
 *
11
 * @author Vitaly Egorov <[email protected]>
12
 */
13
trait CodeTrait
14
{
15
    /** @var array Collection of code lines */
16
    protected $code = [];
17
18
    /**
19
     * Add function code line.
20
     *
21
     * @param string $code Code line
22
     *
23
     * @return $this
24
     */
25
    public function defLine(string $code)
26
    {
27
        $this->code[] = $code;
28
29
        return $this;
30
    }
31
}
32