Skip to content

Commit

Permalink
Enhancement: Enable and configure yoda_style fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 1, 2021
1 parent a9894b6 commit 3c6fcce
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For a full diff see [`2.4.0...main`][2.4.0...main].
### Changed

* Added `Php81` rule set ([#164]), by [@localheinz]
* Enabled and configured `yoda_style` fixer ([#165]), by [@localheinz]

## [`2.4.0`][2.4.0]

Expand Down Expand Up @@ -194,6 +195,7 @@ For a full diff see [`3a0205c...1.0.0`][3a0205c...1.0.0].
[#150]: https://github.com/hks-systeme/php-cs-fixer-config/pull/150
[#157]: https://github.com/hks-systeme/php-cs-fixer-config/pull/157
[#164]: https://github.com/hks-systeme/php-cs-fixer-config/pull/164
[#165]: https://github.com/hks-systeme/php-cs-fixer-config/pull/165

[@dependabot]: https://github.com/apps/dependabot
[@localheinz]: https://github.com/localheinz
7 changes: 6 additions & 1 deletion src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,12 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70100;
}
7 changes: 6 additions & 1 deletion src/RuleSet/Php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,12 @@ final class Php72 extends AbstractRuleSet implements ExplicitRuleSet
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70200;
}
7 changes: 6 additions & 1 deletion src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70300;
}
7 changes: 6 additions & 1 deletion src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,12 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70400;
}
7 changes: 6 additions & 1 deletion src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,12 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 80000;
}
7 changes: 6 additions & 1 deletion src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,12 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 80100;
}
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php71Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,12 @@ final class Php71Test extends ExplicitRuleSetTestCase
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70100;
}
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php72Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,12 @@ final class Php72Test extends ExplicitRuleSetTestCase
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70200;
}
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php73Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,12 @@ final class Php73Test extends ExplicitRuleSetTestCase
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70300;
}
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php74Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,12 @@ final class Php74Test extends ExplicitRuleSetTestCase
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 70400;
}
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php80Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,12 @@ final class Php80Test extends ExplicitRuleSetTestCase
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 80000;
}
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php81Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,12 @@ final class Php81Test extends ExplicitRuleSetTestCase
],
'void_return' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
];
protected $targetPhpVersion = 80100;
}

0 comments on commit 3c6fcce

Please sign in to comment.