52 $this->setCallback($callback);
53 $this->setNumeric($numeric);
56 public function setNumeric($numeric)
58 $this->numeric = $numeric;
62 public function getNumeric()
64 return $this->numeric;
67 public function setCallback(callable $callback)
69 $this->callback = $callback;
73 public function getCallback()
75 return $this->callback;
78 public function handleNumeric(\Erebot\Interfaces\Event\Numeric $numeric)
80 $ourNumeric = ($this->numeric instanceof \Erebot\NumericReference)
81 ? $this->numeric->getValue()
84 if ($numeric->getCode() !== $ourNumeric) {
88 $cb = $this->callback;
89 return $cb($this, $numeric);
A class to handle numeric events.
$numeric
Numeric code handled by this instance.
__construct(callable $callback, $numeric)
$callback
Method/function to call when this handler is triggered.