| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function register($hook, $callback, $priority = 0) { |
||
| 38 | if (!isset($this->hooks[$hook])) { |
||
| 39 | $this->hooks[$hook] = array(); |
||
| 40 | } |
||
| 41 | if (!isset($this->hooks[$hook][$priority])) { |
||
| 42 | $this->hooks[$hook][$priority] = array(); |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->hooks[$hook][$priority][] = $callback; |
||
| 46 | } |
||
| 47 | |||
| 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.