alleyinteractive / alleyinteractive/create-wordpress-plugin

Skip `RemoveUselessVarTagRector` Rector rule to satisfy PHPCS

Open
#514 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
35
Forks
2
Avg merge
1d 11h
Merged PRs (30d)
3

Description

### Description of the bug

PHPCS and Rector are in disagreement about variable comments in classes.

In Rector, the rule is `RemoveUselessVarTagRector`

In PHPCS, the rule is `Squiz.Commenting.VariableComment.MissingVar`

We should skip `Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector::class` in `rector` to satisfy PHPCS and ensure maximum tooling compatibility.

### Steps To Reproduce

1. Create a new plugin with `create-wordpress-plugin`
2. Create a class with a variable, e.g.
```
/**
* REST_API instance.
*
* @var REST_API
*/
private REST_API $api;
```
3. Notice that the presence of `@var REST_API` breaks Rector, and removing `@var REST_API` breaks PHPCS

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.