1 | <?php |
||
51 | class Event extends ObjectAbstract implements EventInterface |
||
52 | { |
||
53 | /** |
||
54 | * event name |
||
55 | * |
||
56 | * @var string |
||
57 | * @access protected |
||
58 | */ |
||
59 | protected $name; |
||
60 | |||
61 | /** |
||
62 | * event context |
||
63 | * |
||
64 | * an object OR static class name (string) |
||
65 | * |
||
66 | * @var object|string |
||
67 | * @access protected |
||
68 | */ |
||
69 | protected $context; |
||
70 | |||
71 | /** |
||
72 | * event properties |
||
73 | * |
||
74 | * @var array |
||
75 | * @access protected |
||
76 | */ |
||
77 | protected $properties; |
||
78 | |||
79 | /** |
||
80 | * Results from the handlers |
||
81 | * |
||
82 | * @var array |
||
83 | * @access protected |
||
84 | */ |
||
85 | protected $results = []; |
||
86 | |||
87 | /** |
||
88 | * stop propagation |
||
89 | * |
||
90 | * @var bool |
||
91 | * @access protected |
||
92 | */ |
||
93 | protected $stopped = false; |
||
94 | |||
95 | /** |
||
96 | * Constructor |
||
97 | * |
||
98 | * @param string $eventName event name |
||
99 | * @param string|object $context event context, object or static classname |
||
100 | * @param array $properties (optional) event properties |
||
101 | * @throws InvalidArgumentException if arguments not right |
||
102 | * @access public |
||
103 | * @api |
||
104 | */ |
||
105 | public function __construct( |
||
112 | |||
113 | /** |
||
114 | * {@inheritDoc} |
||
115 | */ |
||
116 | public function __invoke( |
||
125 | |||
126 | /** |
||
127 | * {@inheritDoc} |
||
128 | */ |
||
129 | public function setName(/*# string */ $eventName) |
||
141 | |||
142 | /** |
||
143 | * {@inheritDoc} |
||
144 | */ |
||
145 | public function getName()/*# : string */ |
||
149 | |||
150 | /** |
||
151 | * {@inheritDoc} |
||
152 | */ |
||
153 | public function setContext($context) |
||
166 | |||
167 | /** |
||
168 | * {@inheritDoc} |
||
169 | */ |
||
170 | public function getContext() |
||
174 | |||
175 | /** |
||
176 | * {@inheritDoc} |
||
177 | */ |
||
178 | public function hasProperty(/*# string */ $name)/*#: bool */ |
||
182 | |||
183 | /** |
||
184 | * {@inheritDoc} |
||
185 | */ |
||
186 | public function getProperty(/*# string */ $name) |
||
193 | |||
194 | /** |
||
195 | * {@inheritDoc} |
||
196 | */ |
||
197 | public function setProperty(/*# string */ $name, $value) |
||
206 | |||
207 | /** |
||
208 | * {@inheritDoc} |
||
209 | */ |
||
210 | public function getProperties()/*# : array */ |
||
214 | |||
215 | /** |
||
216 | * {@inheritDoc} |
||
217 | */ |
||
218 | public function setProperties(array $properties) |
||
223 | |||
224 | /** |
||
225 | * {@inheritDoc} |
||
226 | */ |
||
227 | public function addResult($result) |
||
232 | |||
233 | /** |
||
234 | * {@inheritDoc} |
||
235 | */ |
||
236 | public function getResults()/*# : array */ |
||
240 | |||
241 | /** |
||
242 | * {@inheritDoc} |
||
243 | */ |
||
244 | public function stopPropagation(/*# bool */ $stop = true) |
||
249 | |||
250 | /** |
||
251 | * {@inheritDoc} |
||
252 | */ |
||
253 | public function isPropagationStopped()/*# : bool */ |
||
257 | |||
258 | /** |
||
259 | * {@inheritDoc} |
||
260 | */ |
||
261 | public function offsetExists($offset)/*# : bool */ |
||
265 | |||
266 | /** |
||
267 | * {@inheritDoc} |
||
268 | */ |
||
269 | public function offsetGet($offset) |
||
273 | |||
274 | /** |
||
275 | * {@inheritDoc} |
||
276 | */ |
||
277 | public function offsetSet($offset, $value) |
||
281 | |||
282 | /** |
||
283 | * {@inheritDoc} |
||
284 | */ |
||
285 | public function offsetUnset($offset) |
||
289 | } |
||
290 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.