public function setType($type)
    {
        if (strlen($type) == 0) {
            throw new \InvalidArgumentException(sprintf('MIME type should not be empty'));
        }

        if (!preg_match('@^[^/]+/[^/]+$@', $type)) {
            throw new \InvalidArgumentException(sprintf('Invalid MIME type: %s', $type));
        }

        $this->type = $type;

        return $this;
    }
public function setType($type)
    {
        if (strlen($type) == 0) {
            throw new \InvalidArgumentException(sprintf('MIME type should not be empty'));
        }

        if (!preg_match('@^[^/]+/[^/]+$@', $type)) {
            throw new \InvalidArgumentException(sprintf('Invalid MIME type: %s', $type));
        }

        $this->type = $type;

        return $this;
    }
public function setType ( $ type ) { if ( strlen ( $ type ) == 0 ) { throw new \ InvalidArgumentException ( sprintf ( 'MIME type should not be empty' ) ) ; } if ( ! preg_match ( '@^[^/]+/[^/]+$@' , $ type ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid MIME type: %s' , $ type ) ) ; } $ this -> type = $ type ; return $ this ; }
Sets type.

@param string $type

@return FeedItemEnclosure

@throws \InvalidArgumentException
Sets type .