Set type

@param  string $type
@return $this
556125
public function of($type)
    {
        $type = strtolower($type);

        switch ($type) {

            case 'image':
            case 'jpg':
            case 'jpeg': {
                $this->type = 'jpg';
                break;
            }

            case 'audio':
            case 'mp3': {
                $this->type = 'mp3';
                break;
            }

            default: {
                if (in_array($type, ['png', 'pdf', 'doc', 'docx', 'odt'])) {
                    $this->type = $type;
                } else {
                    throw new InvalidArgumentException("Given type [$type] is incorrect.");
                }
            }
        }

        return $this;
    }
768079
public function setType($type) {
		if(!in_array($type, self::VALID_TYPES)) {
			throw new InvalidArgumentException('Invalid cause type.');
		}

		$this->type = $type;

		return $this;
	}
779471
public function setObjectType($type)
    {
        if (!is_null($type)) {
            $type = (string) $type;
        }

        $this->objectType = $type;
        return $this;
    }
817910
public function setType($type)
    {
        if (!array_key_exists($type, $this->allowConditionRunType)) {
            $errMsg = sprintf('Not allowed type %s', $type);
            throw new Exception\InvalidMetadataException($errMsg);
        }
        $this->type = $type;

        return $this;
    }
911468
public function setFullyQualifiedType(string $type): self
    {
        if ('' === $type) {
            $this->fully_qualified_type = '';

            return $this;
        }

        if ($type[0] === '\\') {
            $this->fully_qualified_type = $type;

            return $this;
        }

        throw new \DomainException(sprintf('The type %s is not a valid fully qualified class name', $type));
    }
1027702
public function setType($type)
    {
        if (!in_array($type, $this->_types)) {
            require_once 'Zend/Server/Exception.php';
            throw new Zend_Server_Exception('Invalid method callback type  passed to ' . __CLASS__ . '::' . __METHOD__);
        }
        $this->_type = $type;
        return $this;
    }
96259
public function setType($type)
    {
        if (!self::isValidType($type)) {
            throw new \InvalidArgumentException("$type is not a valid event type");
        }

        $this->type = $type;

        return $this;
    }
446772
public function setTypes($attr, $type = null)
    {
        if (is_array($attr))
            $this->inputType = array_merge($this->inputType, $attr);
        else
            $this->inputType[$attr] = $type;

        return $this;
    }
1057626
public function setInputType($type)
    {
        if (empty($type)) {
            $this->inputType = null;
            return $this;
        }

        if (!is_string($type)) {
            throw new InvalidArgumentException(
                'Property input type must be a string'
            );
        }

        $this->inputType = $type;

        return $this;
    }
59971
public function setType($type)
    {
        if (!in_array($type, self::$TYPES)) {
            throw new \InvalidArgumentException(sprintf(
                "Unknown GalleryItem type (given: '%s', available: '%s')",
                $type,
                implode(', ', self::$TYPES)
            ));
        }
        $this->type = $type;

        return $this;
    }
433227
private function setType(string $type): self
    {
        switch ($type) {
            case 'navigator.id.getAssertion': // fall through
            case 'navigator.id.finishEnrollment':
                break;
            default:
                throw new IDE(IDE::MALFORMED_DATA, 'typ');
        }
        $this->typ = $type;
        return $this;
    }
585140
public function setType($type)
    {
        if (! in_array($type, self::$types, true)) {
            throw new InvalidArgumentException(sprintf(
                '"%s" is not a valid type! Valid types: %s',
                $type,
                implode(', ', self::$types)
            ));
        }

        $this->type = $type;

        return $this;
    }
903538
public function setType(?string $type, string $description = null) {
		$this->type = $type;
		if (null !== $description) {
			$this->setTypeDescription($description);
		}

		return $this;
	}
423138
public function setType($type)
    {
        if (!in_array($type, [Constants::GROUP_TYPE_AV_CHAT_ROOM, Constants::GROUP_TYPE_B_CHAT_ROOM, Constants::GROUP_TYPE_CHAT_ROOM, Constants::GROUP_TYPE_PRIVATE, Constants::GROUP_TYPE_PUBLIC])) {
            throw new InvalidArgumentException('Group type is incorrect.');
        }
        $this->setParameter('Type', $type);
        return $this;
    }
792774
public function setType($type)
    {
        if(is_array($type) === true) {
            $type    = $type[key($type)];
        }

        $this->types = array_flip($this->types);
        if (isset($this->types[$type]) === true) {

            $this->widget = $type;

        }

        return $this;
    }
18504
public function setEncType($type) {

		$type = strtolower($type);

		if($type != 'application/x-www-form-urlencoded' && $type != 'multipart/form-data' && !empty($type)) {
			throw new HtmlFormException("Invalid form enctype: '$type'.", HtmlFormException::INVALID_ENCTYPE);
		}

		$this->encType = $type;

		return $this;

	}
399321
public function setContentType($type)
    {
        $this->headerBag->appendPair('Content-Type', sprintf('%s;charset=%s', $type, $this->charset));
        return $this;
    }