Skip to content

Commit 8ec5562

Browse files
[BUGFIX] Avoid yoda-style conditions in PHP (#31)
* [BUGFIX] Avoid yoda-style conditions in PHP This commit streamlines the PHP-CS-Fixer rules with TYPO3/typo3@0fb53e0 which added configuration to disable yoda-style conditions. * Fix rules count Co-authored-by: Simon Gilli <[email protected]>
1 parent 1c6187a commit 8ec5562

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: src/CsFixerConfig.php

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class CsFixerConfig extends Config
9191
'single_trait_insert_per_statement' => true,
9292
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
9393
'whitespace_after_comma_in_array' => true,
94+
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
9495
];
9596

9697
public function __construct(string $name = 'TYPO3')

Diff for: tests/Unit/CsFixerConfigTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testCreateReturnsCorrectClass(): void
2626
$config = CsFixerConfig::create();
2727
self::assertInstanceOf(CsFixerConfig::class, $config);
2828
self::assertTrue($config->getRiskyAllowed());
29-
self::assertCount(49, $config->getRules());
29+
self::assertCount(50, $config->getRules());
3030
}
3131

3232
public function testAddRules(): void

0 commit comments

Comments
 (0)