Skip to content

Commit

Permalink
minor #5459 DX: cleanup PHP Migration rulesets (keradus)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.17 branch.

Discussion
----------

DX: cleanup PHP Migration rulesets

Commits
-------

9e53d08 DX: cleanup PHP Migration rulesets
  • Loading branch information
keradus committed Jan 20, 2021
2 parents 206241b + 9e53d08 commit f7b5245
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Execute migration rules
if: matrix.execute-migration-rules == 'yes'
run: php php-cs-fixer fix --rules @PHP73Migration,@PHP71Migration:risky,blank_line_after_opening_tag -q
run: php php-cs-fixer fix --rules @PHP80Migration,@PHP80Migration:risky,blank_line_after_opening_tag -q

- name: Disable time limit for tests when collecting coverage
if: matrix.calculate-code-coverage == 'yes'
Expand Down
3 changes: 1 addition & 2 deletions doc/ruleSets/PHP80Migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Rules to improve code for PHP 8.0 compatibility.
Rules
-----

- `@PHP73Migration <./PHP73Migration.rst>`_
- `@PHP74Migration <./PHP74Migration.rst>`_
- `clean_namespace <./../rules/namespace_notation/clean_namespace.rst>`_
- `no_unset_cast <./../rules/cast_notation/no_unset_cast.rst>`_
- `normalize_index_brace <./../rules/array_notation/normalize_index_brace.rst>`_
3 changes: 1 addition & 2 deletions doc/ruleSets/PHP80MigrationRisky.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Rules to improve code for PHP 8.0 compatibility. This set contains rules that ar
Rules
-----

- `@PHP71Migration:risky <./PHP71MigrationRisky.rst>`_
- `implode_call <./../rules/function_notation/implode_call.rst>`_
- `@PHP74Migration:risky <./PHP74MigrationRisky.rst>`_
- `no_alias_functions <./../rules/alias/no_alias_functions.rst>`_
config:
``['sets' => ['@all']]``
Expand Down
3 changes: 3 additions & 0 deletions doc/rules/cast_notation/short_scalar_cast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ The rule is part of the following rule sets:
@PHP74Migration
Using the `@PHP74Migration <./../../ruleSets/PHP74Migration.rst>`_ rule set will enable the ``short_scalar_cast`` rule.

@PHP80Migration
Using the `@PHP80Migration <./../../ruleSets/PHP80Migration.rst>`_ rule set will enable the ``short_scalar_cast`` rule.

@PhpCsFixer
Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``short_scalar_cast`` rule.

Expand Down
5 changes: 4 additions & 1 deletion doc/rules/function_notation/use_arrow_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ Example #1
Rule sets
---------

The rule is part of the following rule set:
The rule is part of the following rule sets:

@PHP74Migration:risky
Using the `@PHP74Migration:risky <./../../ruleSets/PHP74MigrationRisky.rst>`_ rule set will enable the ``use_arrow_functions`` rule.

@PHP80Migration:risky
Using the `@PHP80Migration:risky <./../../ruleSets/PHP80MigrationRisky.rst>`_ rule set will enable the ``use_arrow_functions`` rule.
3 changes: 1 addition & 2 deletions src/RuleSet/Sets/PHP80MigrationRiskySet.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ final class PHP80MigrationRiskySet extends AbstractRuleSetDescription
public function getRules()
{
return [
'@PHP71Migration:risky' => true,
'implode_call' => true,
'@PHP74Migration:risky' => true,
'no_alias_functions' => [
'sets' => [
'@all',
Expand Down
3 changes: 1 addition & 2 deletions src/RuleSet/Sets/PHP80MigrationSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ final class PHP80MigrationSet extends AbstractRuleSetDescription
public function getRules()
{
return [
'@PHP73Migration' => true,
'@PHP74Migration' => true,
'clean_namespace' => true,
'no_unset_cast' => true,
'normalize_index_brace' => true,
];
}

Expand Down

0 comments on commit f7b5245

Please sign in to comment.