1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author stev leibelt <[email protected]> |
4
|
|
|
* @since 2014-05-24 |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\BlockGeneratorFactory; |
8
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\ClassGeneratorFactory; |
9
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\ConstantGeneratorFactory; |
10
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\DocumentationGeneratorFactory; |
11
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\FileGeneratorFactory; |
12
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\InterfaceGeneratorFactory; |
13
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\LineGeneratorFactory; |
14
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\MethodGeneratorFactory; |
15
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\PropertyGeneratorFactory; |
16
|
|
|
use Net\Bazzline\Component\CodeGenerator\Factory\TraitGeneratorFactory; |
17
|
|
|
use Net\Bazzline\Component\CodeGenerator\Indention; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Class AbstractExample |
21
|
|
|
* @package Net\Bazzline\Component\CodeGenerator\Example |
22
|
|
|
*/ |
23
|
|
|
abstract class AbstractExample |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* @return mixed |
27
|
|
|
*/ |
28
|
|
|
abstract function demonstrate(); |
|
|
|
|
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @return BlockGeneratorFactory |
32
|
|
|
*/ |
33
|
|
|
final protected function getBlockGeneratorFactory() |
34
|
|
|
{ |
35
|
|
|
return new BlockGeneratorFactory(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return ClassGeneratorFactory |
40
|
|
|
*/ |
41
|
|
|
final protected function getClassGeneratorFactory() |
42
|
|
|
{ |
43
|
|
|
return new ClassGeneratorFactory(); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return ConstantGeneratorFactory |
48
|
|
|
*/ |
49
|
|
|
final protected function getConstantGeneratorFactory() |
50
|
|
|
{ |
51
|
|
|
return new ConstantGeneratorFactory(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return DocumentationGeneratorFactory |
56
|
|
|
*/ |
57
|
|
|
final protected function getDocumentationGeneratorFactory() |
58
|
|
|
{ |
59
|
|
|
return new DocumentationGeneratorFactory(); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return FileGeneratorFactory |
64
|
|
|
*/ |
65
|
|
|
final protected function getFileGeneratorFactory() |
66
|
|
|
{ |
67
|
|
|
return new FileGeneratorFactory(); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return Indention |
72
|
|
|
*/ |
73
|
|
|
final protected function getIndention() |
74
|
|
|
{ |
75
|
|
|
return new Indention(); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return LineGeneratorFactory |
80
|
|
|
*/ |
81
|
|
|
final protected function getLineGeneratorFactory() |
82
|
|
|
{ |
83
|
|
|
return new LineGeneratorFactory(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return MethodGeneratorFactory |
88
|
|
|
*/ |
89
|
|
|
final protected function getMethodGeneratorFactory() |
90
|
|
|
{ |
91
|
|
|
return new MethodGeneratorFactory(); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return PropertyGeneratorFactory |
96
|
|
|
*/ |
97
|
|
|
final protected function getPropertyGeneratorFactory() |
98
|
|
|
{ |
99
|
|
|
return new PropertyGeneratorFactory(); |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return InterfaceGeneratorFactory |
104
|
|
|
*/ |
105
|
|
|
final protected function getInterfaceGeneratorFactory() |
106
|
|
|
{ |
107
|
|
|
return new InterfaceGeneratorFactory(); |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @return TraitGeneratorFactory |
112
|
|
|
*/ |
113
|
|
|
final protected function getTraitGeneratorFactory() |
114
|
|
|
{ |
115
|
|
|
return new TraitGeneratorFactory(); |
116
|
|
|
} |
117
|
|
|
} |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.