群组类别
@param string $type
@return $this
@throws InvalidArgumentException
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;
    }
10804
public function setFromType($fromType)
    {
        $allowedValues = $this->getFromTypeAllowableValues();
        if (!in_array($fromType, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'fromType', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['fromType'] = $fromType;

        return $this;
    }
901989
public function setType(string $type):self
    {
        if (!isset($this->types[$type])) {
            Checkers::notice('Unknown response type [' . $type . ']');
        } else {
            $this->type = $type;
        }
        return $this;
    }
1097424
protected function setType(string $type) : void
    {
        if (empty($type)) {
            throw new InvalidArgumentException(__CLASS__ . ': Empty field type is not allowed');
        }

        if (! in_array($type, array_keys($this->defaultOptions))) {
            throw new InvalidArgumentException(__CLASS__ . ': Unsupported field type: ' . $type);
        }

        $this->type = $type;
    }
325613
public function setType(Type $type)
    {
        if ($this->type !== $type) {
            $this->type = $type;
            $type->setItem($this);
        }

        return $this;
    }
1079737
public function rules($type)
	{
		$type = strtolower(trim($type));

		if (!isset($this->rules[$type]))
		{
			throw new InvalidArgumentException(sprintf('Rule type of %s not supported', $type));
		}

		return $this->rules[$type];
	}
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;
    }
184300
private function build(string $type)
    {
        if (!in_array($type, ['public', 'local'])) {
            throw new \InvalidArgumentException('type accepts public or local');
        }
        if (!$this->called) {
            $url = $type === 'public' ? $this->config->env['public'] : $this->config->env['local'];
            $url = rtrim($url, '/');
            Util::clearDirectory($this->config->path('cache'));
            $articles        = ArticleGenerator::getArticles($this->config->path('article'), $url);
            $paths = $this->config->paths;
            $articles->each(function ($article) use ($paths) {
                $article->createCache("{$paths['cache']}/article");
            });
            $this->generator = new SiteGenerator($this->config, $articles);
            $this->called    = true;
        }
        Util::clearDirectory($this->config->path($type), true);
        $this->generator->generate($type);
    }
1141389
public function setType($type)
    {
        if (empty($type)) {
            $this->type = null;
            return $this;
        }

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

        if ($this->propertyFactory()->isResolvable($type)) {
            $this->setPropertyType($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;
    }
132690
public static function getType($type)
    {
        if (!isset(self::$typesMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid type specified "%s".', $type));
        }
        if (!isset(self::$typeObjects[$type])) {
            $className                = self::$typesMap[$type];
            self::$typeObjects[$type] = new $className;
        }

        return self::$typeObjects[$type];
    }
203064
public function withType(string $type): self
    {
        $this->type = UserPermissionEnum::ensureValid($type);
        return $this;
    }
184990
public function setDisplayType($type)
    {
        if (empty($type)) {
            $this->displayType = null;
            return $this;
        }

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

        $this->displayType = $type;

        return $this;
    }
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;
    }
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;
    }
458051
public function withType(string $type): self
    {
        $this->type = IdentityProviderEnum::ensureValid($type);
        return $this;
    }
41521
public function setExportHandler($type)
    {
        if (
            $type === self::EXPORT_NORMAL ||
            $type === self::EXPORT_ARRAY ||
            $type === self::EXPORT_SKIP ||
            is_callable($type)
        ) {
            $this->exportHandler = $type;
            return $this;
        }

        throw new InvalidArgumentException(
            "invalid value provided for 'type'; ".
            "expecting a callable, or one of the following contstants: ".
            "sndsgd\Field::EXPORT_NORMAL, sndsgd\Field::EXPORT_ARRAY, or ".
            "sndsgd\Field::EXPORT_SKIP"
        );
    }