ECSConfig
Provides the default ECS configuration.
Description
Consumers can use this as a starting point and extend it:
$config = \FastForward\DevTools\Config\ECSConfig::configure(); $config->withRules([CustomRule::class]); $config->withConfiguredRule(PhpdocAlignFixer::class, ['align' => 'vertical']); return $config;
Constants
Methods
Applies the default repository paths and skipped rules to an ECS builder.
Applies the default ECS sets, root files, and configured rules to an ECS builder.
Registers PHP-CS-Fixer presets and the legacy Symplify set without deprecated ECS APIs.
Creates the default ECS configuration.
public
array<string|int, mixed>
DEFAULT_CONFIGURED_RULES
=
[\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class => ['align' => 'left'], \PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer::class => ['call_type' => 'self'], \PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer::class => ['only_untyped' => false]]
Description
the configured ECS rules applied by default
public
array<string|int, mixed>
DEFAULT_PHP_CS_FIXER_SETS
=
['symfony' => true, 'symfonyRisky' => true, 'auto' => true, 'autoRisky' => true]
Description
the PHP-CS-Fixer sets applied by default
public
array<string|int, mixed>
DEFAULT_PREPARED_SETS
=
['psr12' => true, 'common' => true, 'symplify' => true, 'cleanCode' => true]
Description
the prepared ECS sets applied by default
public
array<string|int, mixed>
DEFAULT_SKIPPED_RULES
=
[\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class, \PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class, \PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class, \PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class, \PhpCsFixer\Fixer\Import\GlobalNamespaceImportFixer::class, \PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer::class]
Description
the ECS/CS Fixer rules that SHOULD be skipped by default
Applies the default repository paths and skipped rules to an ECS builder.
public
static
applyDefaultPathsAndSkips(ECSConfigBuilder
$config,
string
$workingDirectory) : ECSConfigBuilder
Parameters
$config
:
ECSConfigBuilder
$workingDirectory
:
string
Return values
Applies the default ECS sets, root files, and configured rules to an ECS builder.
public
static
applyDefaultRulesAndSets(ECSConfigBuilder
$config) : ECSConfigBuilder
Parameters
$config
:
ECSConfigBuilder
Return values
Registers PHP-CS-Fixer presets and the legacy Symplify set without deprecated ECS APIs.
public
static
applyPhpCsFixerSets(ECSConfig
$config) : void
Parameters
$config
:
ECSConfig
Creates the default ECS configuration.
public
static
configure([
callable|null
$customize = null]) : ECSConfigBuilder
Parameters
$customize
:
callable|null
=
null
Description
optional callback to customize the configuration builder
Return values
Description
the configured ECS configuration builder