This is the customization rule for the PHP CS Fixer.
By using the rule, You can align vertical positions of class properties.
- Using composer:
composer required-dev takutakuaoao/php-cs-fixer-align-property-rule
In .php-cs-fixer.dist.php file, You need to add this rule.
<?php
use PhpCsFixerAlignPropertyRule\AlignClassPropertiesFixer;
$config = new PhpCsFixer\Config();
return $config
->registerCustomFixers([
AlignClassPropertiesFixer::init(), // add
])
->setRules([
...,
'Takutakuaoao/align_class_properties' => true, // add
]);
We have obviously not tested this on every website. If you run into an issue, or find a way the automatic detection could be better, please create an Issue. If you can include a test case, that's even better.