Skip to content

Commit

Permalink
Re-generate ruleset for friendsofphp/php-cs-fixer 3.62
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick committed Aug 8, 2024
1 parent 4261d66 commit e37dc64
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 10 deletions.
4 changes: 3 additions & 1 deletion config/set/php-cs-fixer-custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\Strict\StrictComparisonFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class, [
'anonymous_class' => false,
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [
Expand Down
4 changes: 3 additions & 1 deletion config/set/php-cs-fixer/per-cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class, [
'anonymous_class' => false,
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [
'inline_constructor_arguments' => false,
'space_before_parenthesis' => true,
Expand Down
4 changes: 3 additions & 1 deletion config/set/php-cs-fixer/per-cs20.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class, [
'anonymous_class' => false,
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [
'inline_constructor_arguments' => false,
'space_before_parenthesis' => true,
Expand Down
4 changes: 3 additions & 1 deletion config/set/php-cs-fixer/per.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class, [
'anonymous_class' => false,
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [
'inline_constructor_arguments' => false,
'space_before_parenthesis' => true,
Expand Down
4 changes: 3 additions & 1 deletion config/set/php-cs-fixer/php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class, [
'anonymous_class' => false,
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [
'single_line' => true,
Expand Down
1 change: 1 addition & 0 deletions config/set/php-cs-fixer/phpunit100-migration-risky.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [
'target' => '5.6',
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitAssertNewNamesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer::class, [
'target' => '7.5',
]);
Expand Down
27 changes: 27 additions & 0 deletions config/set/php-cs-fixer/phpunit91-migration-risky.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [
'target' => '4.3',
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [
'target' => '8.4',
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [
'target' => '6.0',
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [
'target' => '5.5',
]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [
'target' => '5.6',
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitAssertNewNamesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer::class, [
'target' => '7.5',
]);
};
4 changes: 3 additions & 1 deletion config/set/php-cs-fixer/symfony.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class, [
'style' => 'braces',
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer::class, [
'anonymous_class' => false,
]);
$ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [
'single_line' => true,
Expand Down
2 changes: 0 additions & 2 deletions correct/TestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class TestClass implements TestableContract
public $bar;

/**
* TestClass constructor.
*
* @param \Zing\CodingStandard\Correct\Foo $foo the first param
* @param \Zing\CodingStandard\Correct\Bar $bar the second param
*/
Expand Down
2 changes: 1 addition & 1 deletion src/PHPCodeSnifferRuleSetGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function generate(): void
$ruleset->registerSniffs($sniffs, [], []);

file_put_contents(
sprintf(__DIR__ . '/../config/set/php_codesniffer/%s', self::MAP[$setDefinition->getRelativePath()]),
\sprintf(__DIR__ . '/../config/set/php_codesniffer/%s', self::MAP[$setDefinition->getRelativePath()]),
$this->ruleSetPrinter->print($this->formatRulesToServices($ruleset))
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/PhpCsFixerRuleSetGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ final class PhpCsFixerRuleSetGenerator
'@PHPUnit60Migration:risky' => 'phpunit60-migration-risky.php',
'@PHPUnit75Migration:risky' => 'phpunit75-migration-risky.php',
'@PHPUnit84Migration:risky' => 'phpunit84-migration-risky.php',
'@PHPUnit91Migration:risky' => 'phpunit91-migration-risky.php',
'@PHPUnit100Migration:risky' => 'phpunit100-migration-risky.php',
'@PER' => 'per.php',
'@PER:risky' => 'per-risky.php',
Expand Down Expand Up @@ -79,7 +80,7 @@ public function generate(): void
$fixerFactory = new FixerFactory();
$fixerFactory->registerBuiltInFixers();
file_put_contents(
sprintf(__DIR__ . '/../config/set/php-cs-fixer/%s', self::MAP[$setDefinition->getName()]),
\sprintf(__DIR__ . '/../config/set/php-cs-fixer/%s', self::MAP[$setDefinition->getName()]),
$this->ruleSetPrinter->print($this->formatRulesToServices($fixerFactory, $setDefinition))
);
}
Expand Down

0 comments on commit e37dc64

Please sign in to comment.