Completed
Push — master ( eda6ab...289717 )
by Igor
01:38
created

Factory::importGenerator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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