22 lines
812 B
PHP
22 lines
812 B
PHP
<?php
|
|
|
|
use Rector\Config\RectorConfig;
|
|
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
|
|
use Rector\Php80\ValueObject\AnnotationToAttribute;
|
|
|
|
$rector = RectorConfig::configure()
|
|
->withAttributesSets()
|
|
->withPaths([
|
|
__DIR__.'/bundles/',
|
|
]);
|
|
|
|
// graphqlite annotations
|
|
$graphqliteAnnotations = ['Autowire', 'Decorate', 'EnumType', 'ExtendType', 'Factory', 'FailWith', 'Field', 'HideIfUnauthorized', 'HideParameter', 'InjectUser', 'Input', 'Logged', 'MagicField', 'Mutation', 'Query', 'Right', 'Security', 'SourceField', 'Type', 'UseInputType'];
|
|
foreach ($graphqliteAnnotations as $annotation) {
|
|
$rector->withConfiguredRule(AnnotationToAttributeRector::class, [
|
|
new AnnotationToAttribute("TheCodingMachine\GraphQLite\Annotations\\{$annotation}")
|
|
]);
|
|
}
|
|
|
|
return $rector;
|