Neos\Kickstarter\Service\GeneratorService::normalizeFieldDefinitions PHP Method

normalizeFieldDefinitions() protected method

Normalize types and prefix types with namespaces
protected normalizeFieldDefinitions ( array $fieldDefinitions, string $namespace = '' ) : array
$fieldDefinitions array The field definitions
$namespace string The namespace
return array The normalized and type converted field definitions
    protected function normalizeFieldDefinitions(array $fieldDefinitions, $namespace = '')
    {
        foreach ($fieldDefinitions as &$fieldDefinition) {
            if ($fieldDefinition['type'] == 'bool') {
                $fieldDefinition['type'] = 'boolean';
            } elseif ($fieldDefinition['type'] == 'int') {
                $fieldDefinition['type'] = 'integer';
            } elseif (preg_match('/^[A-Z]/', $fieldDefinition['type'])) {
                if (class_exists($fieldDefinition['type'])) {
                    $fieldDefinition['type'] = '\\' . $fieldDefinition['type'];
                } else {
                    $fieldDefinition['type'] = '\\' . $namespace . '\\' . $fieldDefinition['type'];
                }
            }
        }
        return $fieldDefinitions;
    }