Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply rector to the self .phpstorm.meta.php #6593

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 31 additions & 27 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,7 +25,7 @@
);

expectedArguments(
\PHPStan\PhpDocParser\Ast\NodeAttributes::getAttribute(),
(new NodeAttributes())->getAttribute(),
0,
PhpDocAttributeKey::START_AND_END,
PhpDocAttributeKey::LAST_PHP_DOC_TOKEN_POSITION,
Expand All @@ -31,7 +35,7 @@
);

expectedArguments(
\PHPStan\PhpDocParser\Ast\Node::hasAttribute(),
(new Node())->hasAttribute(),
0,
PhpDocAttributeKey::START_AND_END,
PhpDocAttributeKey::LAST_PHP_DOC_TOKEN_POSITION,
Expand All @@ -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,
);
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
__DIR__ . '/utils',
__DIR__ . '/config',
__DIR__ . '/build/build-preload.php',
__DIR__ . '/.phpstorm.meta.php',
])
->withRootFiles()
->withImportNames(removeUnusedImports: true)
Expand Down
Loading