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' => 'right']); 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.
Creates the default ECS configuration.
public
array<class-string, array<string, 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{symfony: bool, symfonyRisky: bool, auto: bool, autoRisky: bool}
DEFAULT_PHP_CS_FIXER_SETS
=
['symfony' => true, 'symfonyRisky' => true, 'auto' => true, 'autoRisky' => true]
Description
the PHP-CS-Fixer sets applied by default
public
array{psr12: bool, common: bool, symplify: bool, strict: bool, cleanCode: bool}
DEFAULT_PREPARED_SETS
=
['psr12' => true, 'common' => true, 'symplify' => true, 'strict' => true, 'cleanCode' => true]
Description
the prepared ECS sets applied by default
public
array<int, class-string>
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
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