1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
14 | abstract class Kohana_Jam_Event { |
||
15 | |||
16 | const ATTRIBUTE_PRIORITY = 20; |
||
17 | const BEHAVIOR_PRIORITY = 10; |
||
18 | |||
19 | protected $serial = 0; |
||
20 | |||
21 | /** |
||
22 | * @var array The current model |
||
23 | */ |
||
24 | protected $_model = NULL; |
||
25 | |||
26 | /** |
||
27 | * @var array Bound events |
||
28 | */ |
||
29 | protected $_events = array(); |
||
30 | |||
31 | /** |
||
32 | * Constructor. |
||
33 | * |
||
34 | * @param string $model |
||
35 | */ |
||
36 | 163 | public function __construct($model) |
|
40 | |||
41 | /** |
||
42 | * Binds an event. |
||
43 | * |
||
44 | * @param string $event |
||
45 | * @param callable $callback |
||
46 | * @return Jam_Event |
||
47 | */ |
||
48 | 155 | public function bind($event, $callback, $priority = 0) |
|
59 | |||
60 | 155 | public function discover_events($from, $priority = 0) |
|
72 | |||
73 | /** |
||
74 | * Triggers an event. |
||
75 | * |
||
76 | * @param string $event |
||
77 | * @param mixed $sender |
||
78 | * @param mixed $params... |
||
79 | * @return mixed |
||
80 | */ |
||
81 | 530 | public function trigger($event, $sender, $params = array()) |
|
113 | |||
114 | /** |
||
115 | * Trigger a callback, if there are no callbacks found, throws an exception |
||
116 | * |
||
117 | * @param string $type 'model', 'builder' or 'meta' |
||
118 | * @param mixed $sender Jam_Model, Jam_Builder or Jam_Meta |
||
119 | * @param string $method |
||
120 | * @param array $params passed to the method |
||
121 | * @return mixed returns the response from the callback |
||
122 | * @throws Jam_Exception_Methodmissing If no method is found |
||
123 | */ |
||
124 | 53 | public function trigger_callback($type, $sender, $method, $params) |
|
133 | } |
||
134 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..