| 1 | <?php |
||
| 15 | class Requests_Hooks implements Requests_Hooker { |
||
| 16 | /** |
||
| 17 | * Registered callbacks for each hook |
||
| 18 | * |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | protected $hooks = array(); |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Constructor |
||
| 25 | */ |
||
| 26 | public function __construct() { |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Register a callback for a hook |
||
| 32 | * |
||
| 33 | * @param string $hook Hook name |
||
| 34 | * @param callback $callback Function/method to call on event |
||
| 35 | * @param int $priority Priority number. <0 is executed earlier, >0 is executed later |
||
| 36 | */ |
||
| 37 | public function register($hook, $callback, $priority = 0) { |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Dispatch a message |
||
| 50 | * |
||
| 51 | * @param string $hook Hook name |
||
| 52 | * @param array $parameters Parameters to pass to callbacks |
||
| 53 | * @return boolean Successfulness |
||
| 54 | */ |
||
| 55 | public function dispatch($hook, $parameters = array()) { |
||
| 68 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.