21 namespace Erebot\Event\Match;
27 class Type implements \Erebot\Interfaces\Event\Match
70 if (!is_array($types)) {
71 $types = array($types);
74 $finalTypes = array();
75 foreach ($types as
$type) {
76 if (is_object($type)) {
77 $type = get_class($type);
80 if (!is_string($type)) {
81 throw new \Erebot\InvalidValueException(
'Not a valid type');
84 $finalTypes[] =
$type;
86 $this->type = $finalTypes;
89 public function match(\Erebot\Interfaces\Event\Base\Generic $event)
91 foreach ($this->type as
$type) {
92 if ($event instanceof $type) {
$type
Type to use in comparisons, as a string.
A filter that matches based on the type of event provided.