Sets the allowed types for the PHP_CodeSniffer::suggestType()

@param array $types
517512
public function setAllowedTypes($types)
    {
        $this->allowedTypes = [];
        $token = ' ,;';
        $type = strtok($types, $token);
        while ($type !== false) {
            $this->allowedTypes[] = $type;
            $type = strtok($token);
        }
    }
909757
public function setReferenceTypes(array $referenceTypes)
    {
        $this->referenceTypes = [];
        foreach ($referenceTypes as $referenceType) {
            $this->addReferenceType($referenceType);
        }

        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;
    }
1163856
public function setAcceptedBaseTypes(array $acceptedBaseTypes)
    {
        foreach ($acceptedBaseTypes as $baseType) {
            if (!in_array($baseType, OperatorBaseType::asArray(), true)) {
                $msg = "Accepted baseTypes must be values from the OperatorBaseType enumeration, '" . $baseType . "' given.";
                throw new InvalidArgumentException($msg);
            }
        }

        $this->acceptedBaseTypes = $acceptedBaseTypes;
    }
900542
public function setAcceptedTypes(array $types)
    {
        /** @var \DOMNodeList $nodes */
        // No REQUIRED — no exception.
        $nodes = $this->query('app:accept');
        foreach ($nodes as $node) {
            $this->getDomElement()->removeChild($node);
        }
        foreach ($types as $type) {
            $element = $this->getDomElement()->ownerDocument
                ->createElementNS($this->ns(), 'accept', $type);
            $this->getDomElement()->appendChild($element);
        }
        $this->setCachedProperty('accept', $types);
    }
839091
public static function create(array $types) : IType
    {
        InvalidArgumentException::verifyAllInstanceOf(__METHOD__, 'types', $types, IType::class);

        $flatTypes = [];
        foreach ($types as $type) {
            if ($type instanceof UnionType) {
                $flatTypes += $type->getTypes();
            } else {
                $flatTypes[$type->asTypeString()] = $type;
            }
        }

        foreach ($flatTypes as $key => $type) {
            foreach ($flatTypes as $otherType) {
                if ($type->isSubsetOf($otherType) && !$type->equals($otherType)) {
                    unset($flatTypes[$key]);
                    continue 2;
                }
            }
        }

        if (count($flatTypes) === 1) {
            return reset($flatTypes);
        }

        $typeString = implode('|', array_keys($flatTypes));

        if (!isset(self::$cache[$typeString])) {
            self::$cache[$typeString] = new self($flatTypes, $typeString);
        }

        return self::$cache[$typeString];
    }
513390
private function doWarm(array $types)
    {
        $warmed = [];
        $this->doClear($types);
        foreach ($types as $type) {
            $this->mf->getMetadataForType($type);
            $warmed[] = $type;
        }
        return $warmed;
    }
1368266
protected function setFromTypes(array $params)
    {
        parent::setFromTypes($params);
        
        if ($this->reduce) {
            $this->reduce();
        }
        
        if ($this->value['den']->get() < 0) {
            //normalise the sign
            $this->value['num']->negate();
            $this->value['den']->negate();
        }
    }
1147266
public function setType($type)
    {
        if (in_array($type, array_keys($this->devices))) {
            $this->type = $type;
        }
    }
1338153
public static function setTypeMsg($type, $msg=null)
    {
        if (is_array($type)) {
            self::$typeMsg=array_merge(self::$typeMsg, $type);
        } else {
            self::$typeMsg[$type]=$msg;
        }
    }
117629
public function guess($value, array $types): ?string
    {
        $this->value = $value;
        $this->setTypes($types);

        return $this
            ->removeNull()
            ->onlyPossible()
            ->reduceScalarTypes()
            ->reduceArrayTypes()
            ->pickArrayForScalar()
            ->conclude();
    }
181650
public function setMapTypeIds(array $types)
    {
        $parsed = [];
        foreach ($types as $type) {
            $parsed[] = MapTypeId::getIsValid($type)
                ? new JsExpression($type)
                : $type;
        }

        $this->options['mapTypeIds'] = $parsed;
    }
739055
public function addAllowedType($type)
    {
        if (!in_array(strtolower($type), $this->allowedTypes)) {
            $this->allowedTypes[] = strtolower($type);
        }
        return $this;
    }
925137
protected function setValues($type)
    {
        switch ($type) {
            case static::CLIENT:
                $this->values = ['cs', 'cr'];
                break;
            case static::SERVER:
                $this->values = ['sr', 'ss'];
                break;
            default:
                throw new \InvalidArgumentException('$type must be TYPE_CLIENT or TYPE_SERVER');
        }
    }
92936
public function setMatchTypes($matchTypes)
	{
		if (is_array($matchTypes)) {
			$this->matchTypes = $matchTypes;
		} else {
			foreach ( (array) $matchTypes as $key => $matchType) {
				$this->matchTypes[$key] = $matchType;
			}
		}
	}
183508
protected function bufferize($types = [])
    {
        while (true) {
            $this->buffer = $this->findNextMessages($types);

            if (\count($this->buffer) > 0) {
                break;
            }

            usleep($this->pause);
        }
    }
1114510
public static function types(array $types)
    {
        $defined = array('boolean', 'integer', 'double', 'string');
        $diff = array_diff($types, $defined);

        if (empty($diff))
        {
            return true;
        }
        throw new dbException('Wrong types: "' . implode(', ', $diff) . '". Available "boolean, integer, double, string, array, object"');
    }