1 | <?php |
||
17 | class DefinitionData |
||
18 | { |
||
19 | |||
20 | const METHOD = 'method'; |
||
21 | const PROPERTY = 'property'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $className; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $arguments = []; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $calls = []; |
||
37 | |||
38 | /** |
||
39 | * Definition Data |
||
40 | * |
||
41 | * @param string $className |
||
42 | * @param array $arguments |
||
43 | * @param array $calls |
||
44 | */ |
||
45 | public function __construct($className, array $arguments = [], array $calls = []) |
||
52 | |||
53 | /** |
||
54 | * Adds a call to the stack |
||
55 | * |
||
56 | * @param string $type |
||
57 | * @param string $name |
||
58 | * @param array $arguments |
||
59 | * |
||
60 | * @return DefinitionData |
||
61 | */ |
||
62 | public function addCall($type, $name, $arguments = []) |
||
71 | |||
72 | /** |
||
73 | * Updated the arguments of the last defined method |
||
74 | * |
||
75 | * @param array $arguments |
||
76 | * |
||
77 | * @return DefinitionData |
||
78 | */ |
||
79 | public function updateLastMethod($arguments) |
||
83 | |||
84 | /** |
||
85 | * Updated the arguments of the last defined property |
||
86 | * |
||
87 | * @param mixed $value |
||
88 | * |
||
89 | * @return DefinitionData |
||
90 | */ |
||
91 | public function updateLastProperty($value) |
||
95 | |||
96 | /** |
||
97 | * @param string $type |
||
98 | * @param mixed $arguments |
||
99 | * |
||
100 | * @return DefinitionData |
||
101 | */ |
||
102 | protected function update($type, $arguments) |
||
114 | |||
115 | public function arguments() |
||
119 | |||
120 | public function withArguments(array $arguments) |
||
124 | |||
125 | public function className() |
||
129 | |||
130 | public function calls() |
||
134 | } |
||
135 |