@param string $type
@param array $pieces

@return bool
345949
protected function containsType(string $type, array $pieces): bool
    {
        if (in_array($type, $pieces)) {
            return true;
        }
        $longTypes = [
            'int' => 'integer',
            'bool' => 'boolean',
        ];
        if (!isset($longTypes[$type])) {
            return false;
        }

        $longType = $longTypes[$type];

        return in_array($longType, $pieces);
    }
356330
public static function has($key, $type = 'ses')
    {
        return ($GLOBALS['TSFE']->fe_user->getKey(self::isType($type), $key)) ? true : false;
    }
1196061
public static function hasOuterArray(string $type) : bool
    {
        $type = self::normalise($type, true);

        return (substr($type, -2) === '[]');
    }
135725
public function hasFieldTypes($type)
    {
        foreach ($this->getFields() as $component)
        {
            if ($component->isFieldType($type)) return true;
        }
    }
338359
public function exchangeDeclare($exchange, $type, $options = array())
    {
        $args = new Writer();
        $args->writeShort($options['ticket'])
            ->writeShortStr($exchange)
            ->writeShortStr($type)
            ->writeBit($options['passive'])
            ->writeBit($options['durable'])
            ->writeBit($options['auto_delete'])
            ->writeBit($options['internal'])
            ->writeBit($options['no_wait'])
            ->writeTable($options['arguments']);
        return $args;
    }
130077
public function isNextAny(array $types)
    {
        if (null === $this->next) {
            return false;
        }

        foreach ($types as $type) {
            if ($type === $this->next[2]) {
                return true;
            }
        }

        return false;
    }
831582
public static function exists($array, $parts)
    {
        if (!self::isArray($array)) {
            throw new \InvalidArgumentException('ArrayUtils::existsByPath expects an array or an ArrayAccess object.');
        }
        foreach (self::explodePath($parts) as $k) {
            if (!static::arrayHasKey($array, $k)) {
                return false;
            }
            $array = $array[$k];
        }

        return true;
    }
971230
public static function isPayByVoucher($type)
    {
        $transactionTypesList = [
            self::PAYBYVOUCHER_YEEPAY,
            self::PAYBYVOUCHER_SALE
        ];

        return in_array(strtolower($type), $transactionTypesList);
    }
292399
public function setType(?string $type): Workflow
    {
        if ($type !== null) {
            Assert::oneOf($type, self::VALID_TYPES);
        }
        $this->type = $type;

        return $this;
    }
1360755
private function overFlowRootDir(string $piece): bool
    {

        $isEmpty = (0 === count($this->stack));

        return $isEmpty && $this->isParentDirectory($piece);
    }
764587
public static function types(array $types)
    {
        $defined = array('boolean', 'integer', 'string', 'double');
        $diff    = array_diff($types, $defined);

        if (empty($diff))
        {
            return TRUE;
        }
        throw new LazerException('Wrong types: "' . implode(', ', $diff) . '". Available "boolean, integer, string, double"');
    }
719154
public function hasRole(string $type, string $name): bool {
        self::checkRoleType($type);
        return isset($this->roles[$type][$name]);
    }
227630
public function nextIf(int $type): bool
    {
        if (!$this->current->typeEquals($type)) {
            return false;
        }

        $this->next();
        return true;
    }
418263
public function nextIfAnyOf(array $types): bool
    {
        if (!$this->current->typeEqualsAnyOf($types)) {
            return false;
        }

        $this->next();
        return true;
    }
644850
public function supportsConstraint($type, array $options = [])
    {
        if (in_array($type, $this->types)) {
            $this->type = $type;
            return true;
        }

        return false;
    }
846013
public function isSingleton($type): bool
    {
        assert(isset($this->types[$type]));
        return $this->types[$type];
    }
1046987
private function validateType(array $types): bool
    {
        $value = $this->value;
        $length = \strlen($value);
        $foundPrefix = false;
        $foundLength = false;
        foreach ($types as $type) {
            foreach ($this->validationData[$type]['prefixes'] as $prefix) {
                if (\substr($value, 0, \strlen($prefix)) == $prefix) {
                    $foundPrefix = true;
                    if (\in_array($length, $this->validationData[$type]['length'])) {
                        $foundLength = true;
                        break 2;
                    }
                }
            }
        }
        if (!$foundPrefix) {
            $this->setError(self::VALIDATOR_ERROR_CREDIT_CARD_NUMBER_PREFIX_NOT_MATCH);
        }
        if (!$foundLength) {
            $this->setError(self::VALIDATOR_ERROR_CREDIT_CARD_NUMBER_LENGTH_NOT_MATCH);
        }
        return $foundPrefix === true && $foundLength === true;
    }