src/PhpToZephir/TypeFinder.php
private function findType(Tag $tag, Node $node, ClassMetadata $classMetadata)
    {
        $rawType = $tag->getType();

        if ($rawType === 'integer') {
            $rawType = 'int';
        }

        $primitiveTypes = array(
            'string',
            'int',
            'integer',
            'float',
            'double',
            'bool',
            'boolean',
            'array',
            'null',
            'callable',
            'scalar',
            'void',
            'object',
        );

        $excludedType = array('mixed', 'callable', 'callable[]', 'scalar', 'scalar[]', 'void', 'object', 'self', 'resource', 'true');

        if (in_array($rawType, $excludedType) === true || count(explode('|', $rawType)) !== 1) {
            return array('value' => '', 'isClass' => false);
        }

        $arrayOfPrimitiveTypes = array_map(function ($val) { return $val.'[]'; }, $primitiveTypes);

        if (class_exists($rawType)) {
            $type = array('value' => $rawType, 'isClass' => true);
        } elseif ($name = $this->isInUse($rawType, $classMetadata)) {
            $type = array('value' => $name, 'isClass' => true);
        } elseif ($name = $this->isInActualNamespaceOrInBase($rawType)) {
            $type = array('value' => $name, 'isClass' => true);
        } elseif (strpos($rawType, '[]')) {
            $type = array('value' => 'array', 'isClass' => false);
        } elseif (preg_match("/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/", $rawType) === 0) { // this is a typo
            $this->logger->logNode(
                sprintf('Type "%s" does not exist in docblock', $rawType),
                $node,
                $classMetadata->getFullQualifiedNameClass()
            );
            $type = array('value' => '', 'isClass' => false);
        } elseif (in_array(strtolower($rawType), $primitiveTypes)) {
            $type = array('value' => strtolower($rawType), 'isClass' => false);
        } elseif (in_array(strtolower($rawType), $arrayOfPrimitiveTypes)) {
            $type = array('value' => strtolower($rawType), 'isClass' => false);
        } else { // considered as class
            $type = array('value' => $rawType, 'isClass' => true);
        }
        


        return $type;
    }
private function findType(Tag $tag, Node $node, ClassMetadata $classMetadata)
    {
        $rawType = $tag->getType();

        if ($rawType === 'integer') {
            $rawType = 'int';
        }

        $primitiveTypes = array(
            'string',
            'int',
            'integer',
            'float',
            'double',
            'bool',
            'boolean',
            'array',
            'null',
            'callable',
            'scalar',
            'void',
            'object',
        );

        $excludedType = array('mixed', 'callable', 'callable[]', 'scalar', 'scalar[]', 'void', 'object', 'self', 'resource', 'true');

        if (in_array($rawType, $excludedType) === true || count(explode('|', $rawType)) !== 1) {
            return array('value' => '', 'isClass' => false);
        }

        $arrayOfPrimitiveTypes = array_map(function ($val) { return $val.'[]'; }, $primitiveTypes);

        if (class_exists($rawType)) {
            $type = array('value' => $rawType, 'isClass' => true);
        } elseif ($name = $this->isInUse($rawType, $classMetadata)) {
            $type = array('value' => $name, 'isClass' => true);
        } elseif ($name = $this->isInActualNamespaceOrInBase($rawType)) {
            $type = array('value' => $name, 'isClass' => true);
        } elseif (strpos($rawType, '[]')) {
            $type = array('value' => 'array', 'isClass' => false);
        } elseif (preg_match("/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/", $rawType) === 0) { // this is a typo
            $this->logger->logNode(
                sprintf('Type "%s" does not exist in docblock', $rawType),
                $node,
                $classMetadata->getFullQualifiedNameClass()
            );
            $type = array('value' => '', 'isClass' => false);
        } elseif (in_array(strtolower($rawType), $primitiveTypes)) {
            $type = array('value' => strtolower($rawType), 'isClass' => false);
        } elseif (in_array(strtolower($rawType), $arrayOfPrimitiveTypes)) {
            $type = array('value' => strtolower($rawType), 'isClass' => false);
        } else { // considered as class
            $type = array('value' => $rawType, 'isClass' => true);
        }
        


        return $type;
    }
@param string $actualNamespace
@param Tag    $tag

@return string