src/Event/Match/Type.php
public function setType($types)
    {
        if (!is_array($types)) {
            $types = array($types);
        }

        $finalTypes = array();
        foreach ($types as $type) {
            if (is_object($type)) {
                $type = get_class($type);
            }

            if (!is_string($type)) {
                throw new \Erebot\InvalidValueException('Not a valid type');
            }

            $finalTypes[] = $type;
        }
        $this->type = $finalTypes;
    }
public function setType($types)
    {
        if (!is_array($types)) {
            $types = array($types);
        }

        $finalTypes = array();
        foreach ($types as $type) {
            if (is_object($type)) {
                $type = get_class($type);
            }

            if (!is_string($type)) {
                throw new \Erebot\InvalidValueException('Not a valid type');
            }

            $finalTypes[] = $type;
        }
        $this->type = $finalTypes;
    }
public function setType ( $ types ) { if ( ! is_array ( $ types ) ) { $ types = array ( $ types ) ; } $ finalTypes = array ( ) ; foreach ( $ types as $ type ) { if ( is_object ( $ type ) ) { $ type = get_class ( $ type ) ; } if ( ! is_string ( $ type ) ) { throw new \ Erebot \ InvalidValueException ( 'Not a valid type' ) ; } $ finalTypes [ ] = $ type ; } $ this -> type = $ finalTypes ; }
Sets the type used in comparisons.

\param $types string|object|array
Type(s) to match incoming events against,
either as a string or as an instance
of the type of match against.
An array of strings/objects may also be passed;
The filter will match if the incoming event
is of any of the types given.

\throw Erebot::InvalidValueException
The given type is invalid.
Sets the type used in comparisons .