- Correct getChoices() docblock to reflect translated label => enum backing value order instead of value => label - Re-indent Smart Links menu config to match actual array nesting - Align assignment operators in RefreshStatsCommand - Add missing newline at end of RefreshStatsCommand.php
73 lines
2.2 KiB
PHP
73 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* PHP-CS-Fixer configuration of the plugin: the same ruleset Mautic core runs
|
|
* (see its .php-cs-fixer.php), minus the custom fixer of the mautic/coding-standards
|
|
* package, which a standalone plugin repository cannot require.
|
|
*
|
|
* Check the coding style (CI runs this with --dry-run --diff):
|
|
*
|
|
* vendor/bin/php-cs-fixer fix --dry-run --diff --config=.php-cs-fixer.dist.php
|
|
*
|
|
* Fix in place:
|
|
*
|
|
* vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php
|
|
*/
|
|
|
|
$finder = (new PhpCsFixer\Finder())
|
|
->in([
|
|
__DIR__.'/Catalog',
|
|
__DIR__.'/Command',
|
|
__DIR__.'/Config',
|
|
__DIR__.'/Controller',
|
|
__DIR__.'/DependencyInjection',
|
|
__DIR__.'/Entity',
|
|
__DIR__.'/Event',
|
|
__DIR__.'/EventListener',
|
|
__DIR__.'/Form',
|
|
__DIR__.'/Integration',
|
|
__DIR__.'/Migrations',
|
|
__DIR__.'/Model',
|
|
__DIR__.'/Security',
|
|
__DIR__.'/Service',
|
|
__DIR__.'/Tests',
|
|
__DIR__.'/Twig',
|
|
__DIR__.'/Validator',
|
|
])
|
|
->append([
|
|
__DIR__.'/MT3SMarketingProgramBundle.php',
|
|
]);
|
|
|
|
return (new PhpCsFixer\Config())
|
|
->setRules([
|
|
'@Symfony' => true,
|
|
'binary_operator_spaces' => [
|
|
'operators' => [
|
|
'=>' => 'align',
|
|
'=' => 'align',
|
|
],
|
|
],
|
|
'phpdoc_to_comment' => false,
|
|
'ordered_imports' => true,
|
|
'array_syntax' => [
|
|
'syntax' => 'short',
|
|
],
|
|
'no_unused_imports' => true,
|
|
/**
|
|
* The plugin's templates use the alternative syntax (endforeach, endif, ...)
|
|
* that Mautic's Twig templates rely on, so the rule stays off like in core.
|
|
*/
|
|
'no_alternative_syntax' => false,
|
|
'header_comment' => [
|
|
'header' => '',
|
|
],
|
|
'multiline_whitespace_before_semicolons' => true,
|
|
'nullable_type_declaration_for_default_null_value' => false, // Enforces potential BC breaks.
|
|
'no_superfluous_phpdoc_tags' => [
|
|
'allow_mixed' => true,
|
|
],
|
|
])
|
|
->setFinder($finder);
|