Completed
Push — master ( a0d4dc...a17c0a )
by Igor
02:03
created

Factory::docBlockGenerator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Leaditin\Code\Generator;
4
5
/**
6
 * @package Leaditin\Code
7
 * @author Igor Vuckovic <[email protected]>
8
 * @license MIT
9
 */
10
class Factory
11
{
12
    /**
13
     * @return ArgumentGenerator
14
     */
15 3
    public function argumentGenerator(): ArgumentGenerator
16
    {
17 3
        return new ArgumentGenerator(
18 3
            $this->typeGenerator(),
19 3
            $this->valueGenerator()
20
        );
21
    }
22
23
    /**
24
     * @return ConstantGenerator
25
     */
26 2
    public function constantGenerator(): ConstantGenerator
27
    {
28 2
        return new ConstantGenerator(
29 2
            $this->valueGenerator(),
30 2
            $this->visibilityGenerator()
31
        );
32
    }
33
34
    /**
35
     * @return DocBlockGenerator
36
     */
37 4
    public function docBlockGenerator(): DocBlockGenerator
38
    {
39 4
        return new DocBlockGenerator(
40 4
            $this->tagGenerator()
41
        );
42
    }
43
44
    /**
45
     * @return MethodGenerator
46
     */
47 2
    public function methodGenerator(): MethodGenerator
48
    {
49 2
        return new MethodGenerator(
50 2
            $this->argumentGenerator(),
51 2
            $this->docBlockGenerator(),
52 2
            $this->typeGenerator(),
53 2
            $this->visibilityGenerator()
54
        );
55
    }
56
57
    /**
58
     * @return PropertyGenerator
59
     */
60 2
    public function propertyGenerator(): PropertyGenerator
61
    {
62 2
        return new PropertyGenerator(
63 2
            $this->docBlockGenerator(),
64 2
            $this->typeGenerator(),
65 2
            $this->valueGenerator(),
66 2
            $this->visibilityGenerator()
67
        );
68
    }
69
70
    /**
71
     * @return TagGenerator
72
     */
73 5
    public function tagGenerator(): TagGenerator
74
    {
75 5
        return new TagGenerator();
76
    }
77
78
    /**
79
     * @return TraitGenerator
80
     */
81 1
    public function traitGenerator(): TraitGenerator
82
    {
83 1
        return new TraitGenerator(
84 1
            $this->constantGenerator(),
85 1
            $this->docBlockGenerator(),
86 1
            $this->methodGenerator(),
87 1
            $this->propertyGenerator()
88
        );
89
    }
90
91
    /**
92
     * @return TypeGenerator
93
     */
94 5
    public function typeGenerator(): TypeGenerator
95
    {
96 5
        return new TypeGenerator();
97
    }
98
99
    /**
100
     * @return ValueGenerator
101
     */
102 6
    public function valueGenerator(): ValueGenerator
103
    {
104 6
        return new ValueGenerator();
105
    }
106
107
    /**
108
     * @return VisibilityGenerator
109
     */
110 5
    public function visibilityGenerator(): VisibilityGenerator
111
    {
112 5
        return new VisibilityGenerator();
113
    }
114
}
115