Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class ResponseAbstract extends ClassGenerator |
||
8 | { |
||
9 | public $properties = []; |
||
10 | |||
11 | protected function formExtends() |
||
12 | { |
||
13 | if (strpos($this->formClassName(), 'ElementResponse')) { |
||
14 | return 'carono\etxtru\ArrayObject'; |
||
15 | } |
||
16 | |||
17 | return 'carono\etxtru\ResponseAbstract'; |
||
18 | } |
||
19 | |||
20 | protected function formClassName() |
||
21 | { |
||
22 | $name = $this->params['name']; |
||
23 | |||
24 | |||
25 | $name = formClassName($name); |
||
26 | if (!isset($this->params['returns']) && substr($name, -1, 1) == 's') { |
||
27 | $name = substr($name, 0, -1) . 'Element'; |
||
28 | } |
||
29 | return $name . 'Response'; |
||
30 | } |
||
31 | |||
32 | protected function formClassNamespace() |
||
33 | { |
||
34 | return 'carono\etxtru\response'; |
||
35 | } |
||
36 | |||
37 | protected function formOutputPath() |
||
38 | { |
||
39 | return dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'response' . DIRECTORY_SEPARATOR . $this->formClassName() . '.php'; |
||
40 | } |
||
41 | |||
42 | protected function classProperties() |
||
54 | } |
||
55 | |||
56 | } |