Add a cache type to use.

@param  string $type The cache type.
@throws InvalidArgumentException If the type is not a string or unsupported.
@return CacheConfig Chainable
192023
public function addType($type)
    {
        if (!in_array($type, $this->validTypes())) {
            throw new InvalidArgumentException(
                sprintf('Invalid cache type: "%s"', $type)
            );
        }

        $this->types[$type] = true;
        return $this;
    }
638969
protected function createType($type, $options = array())
	{
		$type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type);

		$class = __NAMESPACE__ . '\\Type\\' . ucfirst($type);

		if (!class_exists($class))
		{
			throw new InvalidArgumentException("Type [$type] not supported.");
		}

		return new $class($options);
	}
1075408
public function setMimetype($type)
    {
        if ($type === null || $type === false) {
            $this->mimetype = null;

            return $this;
        }

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

        $this->mimetype = $type;

        return $this;
    }
12471
protected function setFileType(/*# string */ $fileType)
    {
        // validate file type
        $class = __NAMESPACE__ . '\\' . ucfirst($fileType) . 'Loader';
        if (!class_exists($class, true)) {
            throw new InvalidArgumentException(
                Message::get(Message::CONFIG_SUFFIX_UNKNOWN, $fileType),
                Message::CONFIG_SUFFIX_UNKNOWN
            );
        }
        $this->file_type = $fileType;
        $this->loader_class = $class;

        return $this;
    }
959964
public function setTypeAttribute($type)
    {
        if (!$type instanceof ContentType) {
            $type = ContentType::getByName($type);
        }
        if (!$type) {
            throw new InvalidArgumentException('Unknown content type');
        }
        $this->type()->associate($type);
    }
1140810
public function setType($type)
    {
        if (is_string($type) && in_array($type, self::$types)) {
            $this->type = $type;
        } else {
            throw new InvalidArgumentException;
        }
    }
1204155
public function addType($type)
    {
        if (func_num_args() > 1) {
            foreach (func_get_args() as $t) {
                $this->addType($t);
            }
        } else {
            if (is_array($type)) {
                foreach ($type as $t) {
                    $this->addType($t);
                }
            } else {
                if (!$this->typeIsAvailable($type)) {
                    $this->types[] = $type;
                }
            }
        }

        return $this;
    }
1313969
public function setType(string $type): self
    {
        if (!\in_array($type, self::COLUMN_TYPES, true)) {
            throw new \InvalidArgumentException('Not supported column type '. $type);
        }

        $this->type = $type;

        return $this;
    }
274950
public function setType(?string $type): self
    {
        if (!$this->isValidType($type)) {
            throw new \InvalidArgumentException(\sprintf(
                "Invalid type '%s'. Must be either NULL, one of %s, or a fully qualified class name or interface",
                $type,
                \implode(', ', $this->getValidTypes())
            ));
        }

        $this->type = $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;
    }
496225
protected static function initializeCache($type)
    {
        if (self::$cache === null) {
            self::$cache = new \stdClass();
        }

        if (!property_exists(self::$cache, $type)) {
            self::$cache->{$type} = new \stdClass();
        }
    }
224229
public function setType($type)
    {
        if (!in_array($type, array(
            self::TYPE_CORE,
            self::TYPE_DISTRIBUTION,
            self::TYPE_CAMPAIGN,
            self::TYPE_MILESTONE,
            self::TYPE_ACTIVITY,
            self::TYPE_OPERATION,
            self::TYPE_CHANNEL,
            self::TYPE_LOCATION,
            self::TYPE_SECURITY,
            self::TYPE_REPORT,
            self::TYPE_REPORT_ANALYTICS,
            self::TYPE_REPORT_BUDGET,
            self::TYPE_REPORT_SALES,
            self::TYPE_HOOK,
            self::TYPE_SYMFONY,
        ))) {
            throw new \InvalidArgumentException("Invalid bundle type.");
        }
        $this->type = $type;

        return $this;
    }
514561
public function addStorageType($type)
    {
        parent::addStorageType($type);

        if (!is_string($type)) {
            return $this;
        }

        foreach ($this->getMessageCollection()->getItems() as $item) {
            $this->storageMessages[$type][] = $item;
        }

        $this->getMessageCollection()->clear();
        return $this;
    }
975238
public static function createType($type)
    {
        if (!isset(static::$typeClasses[$type])) {
            throw new InvalidArgumentException('The asset type "'.$type.'" does not exist, only "'.implode('", "', static::getTypes()).'" are accepted');
        }

        $class = static::$typeClasses[$type];

        return new $class();
    }
1374452
public function setType($type)
    {
        $const = sprintf('%s::TYPE_%s', __CLASS__, strtoupper($type));
        
        if(defined($const))
        {
            $type = constant($const);
        }
        
        $this->setAttributeDirectly('type', $type);
        
        $this->enumerationStrategy = null;
    }
1095423
public function setType( $type )
    {
        $this->type = is_int( $type ) ? $type : self::getStorableType( $type );
        return $this;
    }
623081
public function setType($type)
    {
        $acceptableTypes = ['pivot', 'item'];
        if (!in_array($type, $acceptableTypes)) {
            throw new InvalidConfigException('Browser response bundle must be one of the following types: ' . implode(', ', $acceptableTypes));
        }
        $this->_type = $type;
    }