src/Crossjoin/Css/Format/Rule/AtMedia/MediaQuery.php
public function setType($type)
    {
        if (is_string($type)) {
            if (in_array($type, [
                self::TYPE_ALL, self::TYPE_PRINT, self::TYPE_SCREEN, self::TYPE_SPEECH,
                self::TYPE_AURAL, self::TYPE_BRAILLE, self::TYPE_EMBOSSED, self::TYPE_HANDHELD,
                self::TYPE_PROJECTION, self::TYPE_TTY, self::TYPE_TV
            ])) {
                $this->type = $type;

                return $this;
            } else {
                // Invalid type values have to be handled as "not all"
                // @see: http://dev.w3.org/csswg/mediaqueries-4/#error-handling
                $this->type = self::TYPE_ALL;
                $this->setIsNot(true);
                $this->setIsOnly(false);
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($type). "' for argument 'type' given."
            );
        }
    }
public function setType($type)
    {
        if (is_string($type)) {
            if (in_array($type, [
                self::TYPE_ALL, self::TYPE_PRINT, self::TYPE_SCREEN, self::TYPE_SPEECH,
                self::TYPE_AURAL, self::TYPE_BRAILLE, self::TYPE_EMBOSSED, self::TYPE_HANDHELD,
                self::TYPE_PROJECTION, self::TYPE_TTY, self::TYPE_TV
            ])) {
                $this->type = $type;

                return $this;
            } else {
                // Invalid type values have to be handled as "not all"
                // @see: http://dev.w3.org/csswg/mediaqueries-4/#error-handling
                $this->type = self::TYPE_ALL;
                $this->setIsNot(true);
                $this->setIsOnly(false);
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($type). "' for argument 'type' given."
            );
        }
    }
public function setType ( $ type ) { if ( is_string ( $ type ) ) { if ( in_array ( $ type , [ self :: TYPE_ALL , self :: TYPE_PRINT , self :: TYPE_SCREEN , self :: TYPE_SPEECH , self :: TYPE_AURAL , self :: TYPE_BRAILLE , self :: TYPE_EMBOSSED , self :: TYPE_HANDHELD , self :: TYPE_PROJECTION , self :: TYPE_TTY , self :: TYPE_TV ] ) ) { $ this -> type = $ type ; return $ this ; } else { // Invalid type values have to be handled as "not all" // @see: http://dev.w3.org/csswg/mediaqueries-4/#error-handling $ this -> type = self :: TYPE_ALL ; $ this -> setIsNot ( true ) ; $ this -> setIsOnly ( false ) ; } } else { throw new \ InvalidArgumentException ( "Invalid type '" . gettype ( $ type ) . "' for argument 'type' given." ) ; } }
Sets the media type.

@param string $type
@return $this
Sets the media type .