Skip to content

Commit

Permalink
Enhancement: Enable PhpCsFixerCustomFixers/phpdoc_array_style fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Sep 19, 2023
1 parent 3fcabe6 commit 2fcb5a5
Show file tree
Hide file tree
Showing 26 changed files with 151 additions and 24 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`6.1.0...main`][6.1.0...main].

### Changed

- Required [`kubawerlos/php-cs-fixer-custom-fixers`](https://github.com/kubawerlos/php-cs-fixer-custom-fixers) and enabled the `PhpCsFixerCustomFixers/phpdoc_array_style` fixer ([#894]), by [@localheinz]


## [`6.1.0`][6.1.0]

For a full diff see [`6.0.0...6.1.0`][6.0.0...6.1.0].
Expand Down Expand Up @@ -1225,6 +1230,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#891]: https://github.com/ergebnis/php-cs-fixer-config/pull/891
[#892]: https://github.com/ergebnis/php-cs-fixer-config/pull/892
[#893]: https://github.com/ergebnis/php-cs-fixer-config/pull/893
[#894]: https://github.com/ergebnis/php-cs-fixer-config/pull/894

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ This package is inspired by and also replaces [`localheinz/php-cs-fixer-config`]
This package requires and enables custom fixers from the following packages:

- [`erickskrauch/php-cs-fixer-custom-fixers`](https://github.com/erickskrauch/php-cs-fixer-custom-fixers)
- [`kubawerlos/php-cs-fixer-custom-fixers`](https://github.com/kubawerlos/php-cs-fixer-custom-fixers)

## Social

Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php53.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php53
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php54
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php55
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php56
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php70
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php71
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php72
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php73
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php74
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php80
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php81
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion src/RuleSet/Php82.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;

final class Php82
{
Expand All @@ -31,7 +32,10 @@ public static function create(): RuleSet
);

return RuleSet::create(
Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer()),
Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
),
Name::fromString(\sprintf(
'ergebnis (PHP %d.%d)',
$phpVersion->major()->toInt(),
Expand All @@ -40,6 +44,7 @@ public static function create(): RuleSet
$phpVersion,
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
7 changes: 6 additions & 1 deletion test/Unit/RuleSet/Php53Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet;
use ErickSkrauch\PhpCsFixer;
use PhpCsFixerCustomFixers\Fixer;
use PHPUnit\Framework;

#[Framework\Attributes\CoversClass(RuleSet\Php53::class)]
Expand All @@ -41,7 +42,10 @@ protected static function createRuleSet(): RuleSet

protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer());
return Fixers::fromFixers(
new Fixer\PhpdocArrayStyleFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
);
}

protected function expectedName(): Name
Expand All @@ -53,6 +57,7 @@ protected function expectedRules(): Rules
{
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
Expand Down
Loading

0 comments on commit 2fcb5a5

Please sign in to comment.