Completed
Push — master ( d47fd7...10fc86 )
by Igor
02:26
created

Factory::classGenerator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.9666
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 5
    public function argumentGenerator(): ArgumentGenerator
16
    {
17 5
        return new ArgumentGenerator(
18 5
            $this->typeGenerator(),
19 5
            $this->valueGenerator()
20
        );
21
    }
22
23
    /**
24
     * @return ClassGenerator
25
     */
26 1
    public function classGenerator(): ClassGenerator
27
    {
28 1
        return new ClassGenerator(
29 1
            $this->constantGenerator(),
30 1
            $this->docBlockGenerator(),
31 1
            $this->methodGenerator(),
32 1
            $this->propertyGenerator()
33
        );
34
    }
35
36
    /**
37
     * @return ConstantGenerator
38
     */
39 4
    public function constantGenerator(): ConstantGenerator
40
    {
41 4
        return new ConstantGenerator(
42 4
            $this->docBlockGenerator(),
43 4
            $this->typeGenerator(),
44 4
            $this->valueGenerator(),
45 4
            $this->visibilityGenerator()
46
        );
47
    }
48
49
    /**
50
     * @return DocBlockGenerator
51
     */
52 7
    public function docBlockGenerator(): DocBlockGenerator
53
    {
54 7
        return new DocBlockGenerator(
55 7
            $this->tagGenerator()
56
        );
57
    }
58
59
    /**
60
     * @return InterfaceGenerator
61
     */
62 1
    public function interfaceGenerator(): InterfaceGenerator
63
    {
64 1
        return new InterfaceGenerator(
65 1
            $this->constantGenerator(),
66 1
            $this->docBlockGenerator(),
67 1
            $this->methodGenerator(),
68 1
            $this->propertyGenerator()
69
        );
70
    }
71
72
    /**
73
     * @return MethodGenerator
74
     */
75 4
    public function methodGenerator(): MethodGenerator
76
    {
77 4
        return new MethodGenerator(
78 4
            $this->argumentGenerator(),
79 4
            $this->docBlockGenerator(),
80 4
            $this->typeGenerator(),
81 4
            $this->visibilityGenerator()
82
        );
83
    }
84
85
    /**
86
     * @return PropertyGenerator
87
     */
88 4
    public function propertyGenerator(): PropertyGenerator
89
    {
90 4
        return new PropertyGenerator(
91 4
            $this->docBlockGenerator(),
92 4
            $this->typeGenerator(),
93 4
            $this->valueGenerator(),
94 4
            $this->visibilityGenerator()
95
        );
96
    }
97
98
    /**
99
     * @return TagGenerator
100
     */
101 8
    public function tagGenerator(): TagGenerator
102
    {
103 8
        return new TagGenerator();
104
    }
105
106
    /**
107
     * @return TraitGenerator
108
     */
109 1
    public function traitGenerator(): TraitGenerator
110
    {
111 1
        return new TraitGenerator(
112 1
            $this->constantGenerator(),
113 1
            $this->docBlockGenerator(),
114 1
            $this->methodGenerator(),
115 1
            $this->propertyGenerator()
116
        );
117
    }
118
119
    /**
120
     * @return TypeGenerator
121
     */
122 8
    public function typeGenerator(): TypeGenerator
123
    {
124 8
        return new TypeGenerator();
125
    }
126
127
    /**
128
     * @return ValueGenerator
129
     */
130 8
    public function valueGenerator(): ValueGenerator
131
    {
132 8
        return new ValueGenerator();
133
    }
134
135
    /**
136
     * @return VisibilityGenerator
137
     */
138 7
    public function visibilityGenerator(): VisibilityGenerator
139
    {
140 7
        return new VisibilityGenerator();
141
    }
142
}
143