1 | <?php |
||
19 | abstract class AbstractProxy |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Indent for source code |
||
24 | * |
||
25 | * @var int |
||
26 | */ |
||
27 | protected $indent = 4; |
||
28 | |||
29 | /** |
||
30 | * List of advices that are used for generation of child |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $advices = []; |
||
35 | |||
36 | /** |
||
37 | * PHP expression string for accessing LSB information |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected static $staticLsbExpression = 'static::class'; |
||
42 | |||
43 | /** |
||
44 | * Constructs an abstract proxy class |
||
45 | * |
||
46 | * @param array $advices List of advices |
||
47 | */ |
||
48 | public function __construct(array $advices = []) |
||
52 | |||
53 | /** |
||
54 | * Returns text representation of class |
||
55 | * |
||
56 | 5 | * @return string |
|
57 | */ |
||
58 | 5 | abstract public function __toString(); |
|
59 | 5 | ||
60 | 5 | /** |
|
61 | * Indent block of code |
||
62 | * |
||
63 | * @param string $text Non-indented text |
||
64 | * |
||
65 | * @return string Indented text |
||
66 | */ |
||
67 | protected function indent($text) |
||
76 | 5 | ||
77 | /** |
||
78 | 5 | * Returns list of string representation of parameters |
|
79 | * |
||
80 | 5 | * @param array|ReflectionParameter[] $parameters List of parameters |
|
81 | 5 | * |
|
82 | * @return array |
||
83 | 5 | */ |
|
84 | protected function getParameters(array $parameters) |
||
93 | 5 | ||
94 | /** |
||
95 | 5 | * Return string representation of parameter |
|
96 | 5 | * |
|
97 | * @param ReflectionParameter $parameter Reflection parameter |
||
98 | 2 | * |
|
99 | * @return string |
||
100 | */ |
||
101 | 2 | protected function getParameterCode(ReflectionParameter $parameter) |
|
129 | |||
130 | /** |
||
131 | * Replace concrete advices with list of ids |
||
132 | 2 | * |
|
133 | 2 | * @param $advices |
|
134 | 2 | * |
|
135 | 2 | * @return array flatten list of advices |
|
136 | 2 | */ |
|
137 | 2 | private function flattenAdvices($advices) |
|
150 | 5 | ||
151 | /** |
||
152 | 5 | * Prepares a line with args from the method definition |
|
153 | 5 | * |
|
154 | 5 | * @param ReflectionFunctionAbstract $functionLike |
|
155 | 5 | * |
|
156 | 5 | * @return string |
|
157 | */ |
||
158 | protected function prepareArgsLine(ReflectionFunctionAbstract $functionLike) |
||
186 | } |
||
187 |