@param  string $type

@return Cause

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

		$this->type = $type;

		return $this;
	}
172175
public function setType($type)
    {
        if (!is_string($type)) {
            throw new \InvalidArgumentException('The attribute type on the class Entity has to be string (' . gettype($type) . ('object' === gettype($type) ? ' ' . get_class($type) : '') . ' given).');
        }

        $this->type = $type;

        return $this;
    }
906538
public function setType($type)
    {
        if (is_string($type)) {
            if ('all' == strtolower($type)) {
                $this->type = array_keys($this->cards);
            } else {
                $this->type = explode(',', $type);
            }
        } elseif (is_array($type)) {
            $this->type = $type;
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type array or string, "%s" given',
                is_object($type) ? get_class($type) : gettype($type)
            ));
        }

        return $this;
    }
1115012
public function setType($type = '') {
        if (!\in_array($type, self::$allowed_input_types, true)) {
            throw new InvalidArgumentException('Unsupported column input type. Possible are: ' . implode(', ', self::$allowed_input_types));
        }

        $this->selected_input_type = $type;

        // Update some params based on type
        switch ($this->selected_input_type) {
            case 'checkbox': case 'radio': case 'delete':
                $this->setWidth('1%');
                $this->disableNewlines();
                $this->enableCenterAlign();
            break;
        }

        return $this;
    }
80192
protected function getChangeTrackingPolicyString($type)
    {
        if ( ! isset(static::$changeTrackingPolicyMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid provided ChangeTrackingPolicy: %s', $type));
        }

        return static::$changeTrackingPolicyMap[$type];
    }
302293
public function cacheInvalidate( $type = self::ALL )
    {
        switch( $type ) {
            case self::PERSISTED:
                $return = count( $this->instancesPersisted );
                $this->instancesPersisted = array();
                return $return;
            case self::UNPERSISTED:
                $return = count( $this->instancesUnpersisted );
                $this->instancesUnpersisted = array();
                return $return;
            case self::ALL:
                $return = count( $this->instancesPersisted ) + count( $this->instancesUnpersisted );
                $this->instancesPersisted = array();
                $this->instancesUnpersisted = array();
                return $return;
        }
        throw new \InvalidArgumentException("Bad source `{$source}` passed to " . __FUNCTION__);
    }
752746
public function resolve($type)
    {
        if (!is_string($type)) {
            throw new InvalidArgumentException(
                'Can not resolve class ident: type must be a string'
            );
        }

        $map = $this->map();
        if (isset($map[$type])) {
            $type = $map[$type];
        }

        if (class_exists($type)) {
            return $type;
        }

        $resolver = $this->resolver();
        $resolved = $resolver($type);
        return $resolved;
    }
1271842
public function setTypeAttribute($type)
    {
        if (!$type instanceof FileType) {
            $type = FileType::getByName($type);
        }
        if (!$type) {
            throw new InvalidArgumentException('Unknown file type');
        }
        $this->type()->associate($type);
    }
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;
    }
996442
public function setEncodingType($type)
    {
        if ($type === false || $type === self::RFC1738 || $type === self::RFC3986) {
            $this->encoding = $type;
        } else {
            throw new \InvalidArgumentException('Invalid URL encoding type');
        }

        return $this;
    }
279911
public static function validateType($type)
    {
        if (!in_array($type, [self::TYPE_INFO, self::TYPE_SUCCESS, self::TYPE_WARNING, self::TYPE_ERROR])) {
            throw new \InvalidArgumentException('Invalid resource message type "%s".', $type);
        }
    }
1174160
public function setType($type)
    {
        $allowedValues = $this->getTypeAllowableValues();
        if (!is_null($type) && !in_array($type, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['type'] = $type;

        return $this;
    }
1179087
public function setCaptureType($type)
    {
        if ($type === static::SET
            || $type === static::APPEND
            || $type === static::PREPEND
        ) {
            $this->captureType = $type;

            return $this;
        }

        throw new InvalidArgumentException(sprintf(
            'Invalid capture type provided; must be any of the capture '
            . 'type constants, "%s" received.',
            is_scalar($type) ? $type : gettype($type)
        ));
    }
218292
public function setType($type)
    {
        if ($type === null || $type === 'array') {
            $this->type = $type;

            return $this;
        }

        if ($this->isObjectNameValid($type) !== true) {
            throw new InvalidArgumentException('Parameter type is not valid.');
        }

        $this->type = $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;
    }
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;
    }
382494
private static function validateMiddlewareType(string $type) : string
  {
    if (!in_array($type, self::MIDDLEWARE_TYPES)) {
      throw new \InvalidArgumentException(sprintf(
        'Provided middleware type does not exist. Use one of %s instead.',
        implode(', ', self::MIDDLEWARE_TYPES)
      ));
    }

    return $type;
  }