public function setType($type)
    {
        if (!self::isValidType($type)) {
            throw new \InvalidArgumentException("$type is not a valid event type");
        }

        $this->type = $type;

        return $this;
    }
public function setType($type)
    {
        if (!self::isValidType($type)) {
            throw new \InvalidArgumentException("$type is not a valid event type");
        }

        $this->type = $type;

        return $this;
    }
public function setType ( $ type ) { if ( ! self :: isValidType ( $ type ) ) { throw new \ InvalidArgumentException ( "$type is not a valid event type" ) ; } $ this -> type = $ type ; return $ this ; }
Sets the event type

@param string $type

@return $this
@throw \InvalidArgumentException If the type is not valid
Sets the event type