Skip to content

Commit

Permalink
Merge pull request #61 from worksome/feature/null-style
Browse files Browse the repository at this point in the history
feat: add null union ordering
  • Loading branch information
owenvoke authored Sep 27, 2024
2 parents 6f16ed1 + 308efc6 commit 6a08e60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/WorksomeEcsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedTypesFixer;
use PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer;
use PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer;
use PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer;
use PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer;
use PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer;
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
Expand Down Expand Up @@ -136,6 +138,16 @@ public static function setup(ECSConfig $ecsConfig): void
],
]);

$ecsConfig->ruleWithConfiguration(
NullableTypeDeclarationFixer::class,
['syntax' => 'union']
);

$ecsConfig->ruleWithConfiguration(
OrderedTypesFixer::class,
['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']
);

$ecsConfig->rules([
RequireMultiLineConditionSniff::class,
RequireShortTernaryOperatorSniff::class,
Expand Down

0 comments on commit 6a08e60

Please sign in to comment.