getAnnotationsOfType([AnnotationSchema::class, AttributeSchema::class], true); foreach ($schemas as $schema) { if ($schema->_context->is('enum')) { $source = $schema->_context->enum; $re = new \ReflectionEnum($schema->_context->fullyQualifiedName($source)); $schema->schema = !Generator::isDefault($schema->schema) ? $schema->schema : $re->getShortName(); $schema->enum = array_map(function ($case) { return $case->name; }, $re->getCases()); $type = 'string'; if ($re->isBacked() && ($backingType = $re->getBackingType())) { $type = !Generator::isDefault($schema->type) ? $schema->type : $backingType->getName(); } Util::mapNativeType($schema, $type); } } } }