Skip to content

Commit

Permalink
Remove default skip option (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Mar 16, 2021
1 parent 12d6afc commit 7660f5a
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 269 deletions.
77 changes: 31 additions & 46 deletions config/set/php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,17 @@
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\FunctionNotation\SingleLineThrowFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer;
use PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer;
use PhpCsFixer\Fixer\ReturnNotation\SimplifiedNullReturnFixer;
use PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/../../vendor/symplify/easy-coding-standard/config/set/php-cs-fixer.php', null, true);
Expand All @@ -36,20 +26,16 @@
$containerConfigurator->import(__DIR__ . '/../../../../symplify/easy-coding-standard/config/set/php-cs-fixer.php', null, true);

$services = $containerConfigurator->services();
$services->set(ClassAttributesSeparationFixer::class);
$services->set(MultilineWhitespaceBeforeSemicolonsFixer::class);
$services->set(SimplifiedNullReturnFixer::class);
$services->set(NotOperatorWithSuccessorSpaceFixer::class);
$services->set(LogicalOperatorsFixer::class);
$services->set(OrderedImportsFixer::class)
$services->set(ArraySyntaxFixer::class)
->call(
'configure',
[
[
'importsOrder' => ['class', 'function', 'const'],
'syntax' => 'short',
],
]
);
$services->set(ClassAttributesSeparationFixer::class);
$services->set(ConcatSpaceFixer::class)
->call(
'configure',
Expand All @@ -59,53 +45,58 @@
],
]
);
$services->set(PhpdocAlignFixer::class)
$services->set(IncrementStyleFixer::class)
->call(
'configure',
[
[
'align' => 'left',
'style' => 'post',
],
]
);
$services->set(ArraySyntaxFixer::class)
$services->set(LogicalOperatorsFixer::class);
$services->set(MultilineWhitespaceBeforeSemicolonsFixer::class);
$services->set(NotOperatorWithSuccessorSpaceFixer::class);
$services->set(OrderedClassElementsFixer::class)
->call(
'configure',
[
[
'syntax' => 'short',
'order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private'],
],
]
);
$services->set(VisibilityRequiredFixer::class)
$services->set(OrderedImportsFixer::class)
->call(
'configure',
[
[
'elements' => ['property', 'method', 'const'],
'importsOrder' => ['class', 'function', 'const'],
],
]
);

$services->set(OrderedClassElementsFixer::class)
$services->set(PhpdocAlignFixer::class)
->call(
'configure',
[
[
'order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private'],
'align' => 'left',
],
]
);

$services->set(IncrementStyleFixer::class)
$services->set(PhpdocNoAliasTagFixer::class)
->call(
'configure',
[
[
'style' => 'post',
'replacements' => [
'type' => 'var',
'link' => 'see',
],
],
]
);

$services->set(PhpdocTypesOrderFixer::class)
->call(
'configure',
Expand All @@ -116,21 +107,15 @@
],
]
);
$parameters = $containerConfigurator->parameters();
$parameters->set(
Option::SKIP,
[
UnaryOperatorSpacesFixer::class => null,
SingleLineThrowFixer::class => null,
PhpdocSummaryFixer::class => null,
PhpdocToCommentFixer::class => null,
PhpdocNoEmptyReturnFixer::class => null,
PhpdocNoAliasTagFixer::class => null,
PhpdocTypesOrderFixer::class => null,
PhpUnitTestClassRequiresCoversFixer::class => null,
PhpUnitInternalClassFixer::class => null,
NoSuperfluousPhpdocTagsFixer::class => null,
YodaStyleFixer::class => null,
]
);
$services->set(SimplifiedNullReturnFixer::class);

$services->set(VisibilityRequiredFixer::class)
->call(
'configure',
[
[
'elements' => ['property', 'method', 'const'],
],
]
);
};
Loading

0 comments on commit 7660f5a

Please sign in to comment.