Created
December 28, 2021 21:09
-
-
Save BusterNeece/230f1bf619740b0564b88a69978de82c to your computer and use it in GitHub Desktop.
Revisions
-
BusterNeece created this gist
Dec 28, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ <?php use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); $openApiAnnotationsRaw = [ 'AdditionalProperties', 'Attachable', 'Components', 'Contact', 'Delete', 'Discriminator', 'Examples', 'ExternalDocumentation', 'Flow', 'Get', 'Head', 'Header', 'Info', 'Items', 'JsonContent', 'License', 'Link', 'MediaType', 'OpenApi', 'Operation', 'Options', 'Parameter', 'Patch', 'PatchItem', 'PathParameter', 'Post', 'Property', 'Put', 'RequestBody', 'Response', 'Schema', 'SecurityScheme', 'Server', 'ServerVariable', 'Tag', 'Trace', 'Xml', 'XmlContent', ]; $openApiAnnotations = []; foreach ($openApiAnnotationsRaw as $className) { $openApiAnnotations[] = new \Rector\Php80\ValueObject\AnnotationToAttribute( 'OpenApi\\Annotations\\' . $className, 'OpenApi\\Attributes\\' . $className ); } $services->set(AnnotationToAttributeRector::class) ->configure($openApiAnnotations); };