Test Failed
Branch v5 (12d602)
by Alexey
04:51
created

Property   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 11 3
1
<?php
2
3
/**
4
 * Property
5
 *
6
 * @author Alexey Krupskiy <[email protected]>
7
 * @link http://inji.ru/
8
 * @copyright 2015 Alexey Krupskiy
9
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
10
 */
11
12
namespace Inji\CodeGenerator;
13
14
class Property extends \Inji\InjiObject {
15
16
    public $security = 'public';
17
    public $static = false;
18
    public $name = 'property';
19
    public $value = 'value';
20
21
    public function generate() {
22
        $code = $this->security . ' ';
23
        $code .= $this->static ? 'static ' : '';
24
        $code .= '$' . $this->name . ' = ';
25
        if (is_array($this->value)) {
26
            $code .= \CodeGenerator::genArray($this->value);
27
        } else {
28
            $code .= '"' . str_replace('"', '\"', $this->value) . '";';
29
        }
30
        return $code;
31
    }
32
33
}
34