Completed
Push — master ( 062389...d47fd7 )
by Igor
01:55
created

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