diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index c677c8cad5c..e9edc4068fa 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -5,13 +5,17 @@ // see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata namespace PHPSTORM_META; -// $container->get(Type::class) → instance of "Type" +use Psr\Container\ContainerInterface; +use PHPStan\PhpDocParser\Ast\Node; +use PHPStan\PhpDocParser\Ast\NodeAttributes; +use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey; -override(\Psr\Container\ContainerInterface::get(0), type(0)); +// $container->get(Type::class) → instance of "Type" +override((new ContainerInterface())->get(0), type(0)); expectedArguments( - \PHPStan\PhpDocParser\Ast\Node::getAttribute(), + (new Node())->getAttribute(), 0, PhpDocAttributeKey::START_AND_END, PhpDocAttributeKey::LAST_PHP_DOC_TOKEN_POSITION, @@ -21,7 +25,7 @@ ); expectedArguments( - \PHPStan\PhpDocParser\Ast\NodeAttributes::getAttribute(), + (new NodeAttributes())->getAttribute(), 0, PhpDocAttributeKey::START_AND_END, PhpDocAttributeKey::LAST_PHP_DOC_TOKEN_POSITION, @@ -31,7 +35,7 @@ ); expectedArguments( - \PHPStan\PhpDocParser\Ast\Node::hasAttribute(), + (new Node())->hasAttribute(), 0, PhpDocAttributeKey::START_AND_END, PhpDocAttributeKey::LAST_PHP_DOC_TOKEN_POSITION, @@ -44,31 +48,31 @@ // PhpStorm 2019.1 - add argument autocomplete // https://blog.jetbrains.com/phpstorm/2019/02/new-phpstorm-meta-php-features/ expectedArguments( - \PhpParser\Node::getAttribute(), + (new \PhpParser\Node())->getAttribute(), 0, - \Rector\NodeTypeResolver\Node\AttributeKey::SCOPE, - \Rector\NodeTypeResolver\Node\AttributeKey::REPRINT_RAW_VALUE, - \Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NODE, - \Rector\NodeTypeResolver\Node\AttributeKey::IS_UNREACHABLE, - \Rector\NodeTypeResolver\Node\AttributeKey::PHP_DOC_INFO, - \Rector\NodeTypeResolver\Node\AttributeKey::KIND, - \Rector\NodeTypeResolver\Node\AttributeKey::IS_REGULAR_PATTERN, - \Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NAME, - \Rector\NodeTypeResolver\Node\AttributeKey::COMMENTS, - \Rector\NodeTypeResolver\Node\AttributeKey::RAW_VALUE, + AttributeKey::SCOPE, + AttributeKey::REPRINT_RAW_VALUE, + AttributeKey::ORIGINAL_NODE, + AttributeKey::IS_UNREACHABLE, + AttributeKey::PHP_DOC_INFO, + AttributeKey::KIND, + AttributeKey::IS_REGULAR_PATTERN, + AttributeKey::ORIGINAL_NAME, + AttributeKey::COMMENTS, + AttributeKey::RAW_VALUE, ); expectedArguments( - \PhpParser\Node::setAttribute(), + (new \PhpParser\Node())->setAttribute(), 0, - \Rector\NodeTypeResolver\Node\AttributeKey::SCOPE, - \Rector\NodeTypeResolver\Node\AttributeKey::REPRINT_RAW_VALUE, - \Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NODE, - \Rector\NodeTypeResolver\Node\AttributeKey::IS_UNREACHABLE, - \Rector\NodeTypeResolver\Node\AttributeKey::PHP_DOC_INFO, - \Rector\NodeTypeResolver\Node\AttributeKey::KIND, - \Rector\NodeTypeResolver\Node\AttributeKey::IS_REGULAR_PATTERN, - \Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NAME, - \Rector\NodeTypeResolver\Node\AttributeKey::COMMENTS, - \Rector\NodeTypeResolver\Node\AttributeKey::RAW_VALUE, + AttributeKey::SCOPE, + AttributeKey::REPRINT_RAW_VALUE, + AttributeKey::ORIGINAL_NODE, + AttributeKey::IS_UNREACHABLE, + AttributeKey::PHP_DOC_INFO, + AttributeKey::KIND, + AttributeKey::IS_REGULAR_PATTERN, + AttributeKey::ORIGINAL_NAME, + AttributeKey::COMMENTS, + AttributeKey::RAW_VALUE, ); diff --git a/rector.php b/rector.php index 997d7c85b14..3fb927e4a45 100644 --- a/rector.php +++ b/rector.php @@ -33,6 +33,7 @@ __DIR__ . '/utils', __DIR__ . '/config', __DIR__ . '/build/build-preload.php', + __DIR__ . '/.phpstorm.meta.php', ]) ->withRootFiles() ->withImportNames(removeUnusedImports: true)