Nextras\Orm\Entity\Reflection\MetadataParser::parseAnnotationTypes PHP Méthode

parseAnnotationTypes() protected méthode

protected parseAnnotationTypes ( PropertyMetadata $property, $typesString )
$property PropertyMetadata
    protected function parseAnnotationTypes(PropertyMetadata $property, $typesString)
    {
        static $allTypes = ['array', 'bool', 'boolean', 'double', 'float', 'int', 'integer', 'mixed', 'numeric', 'number', 'null', 'object', 'real', 'string', 'text', 'void', 'datetime', 'datetimeimmutable', 'scalar'];
        static $alliases = ['double' => 'float', 'real' => 'float', 'numeric' => 'float', 'number' => 'float', 'integer' => 'int', 'boolean' => 'bool'];
        $types = [];
        foreach (explode('|', $typesString) as $type) {
            if (strpos($type, '[') !== false) {
                // Class[]
                $type = 'array';
            } elseif (!in_array(strtolower($type), $allTypes, true)) {
                $type = $this->makeFQN($type);
            } elseif (isset($alliases[strtolower($type)])) {
                $type = $alliases[strtolower($type)];
            }
            $types[$type] = true;
        }
        $property->isNullable = isset($types['null']) || isset($types['NULL']);
        unset($types['null'], $types['NULL']);
        $property->types = $types;
    }