first commit
This commit is contained in:
21
rector.php
Normal file
21
rector.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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;
|
||||
Reference in New Issue
Block a user