| 1 | <?php |
||
| 27 | class Event extends CakeEvent |
||
| 28 | { |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Custom data for the method that receives the event |
||
| 32 | * |
||
| 33 | * @var Data |
||
| 34 | */ |
||
| 35 | public $data; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Event constructor. |
||
| 39 | * |
||
| 40 | * @param string $name |
||
| 41 | * @param null|string $subject |
||
| 42 | * @param null|array $data |
||
| 43 | */ |
||
| 44 | public function __construct($name, $subject = null, $data = null) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Access the event data/payload. |
||
| 52 | * |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function data() |
||
| 59 | } |
||
| 60 |
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.