mirror of
https://github.com/elyby/php-code-style.git
synced 2026-05-04 05:01:54 +05:30
Add fixer to place promoted properties on a new line when there is more than 1 parameter
This commit is contained in:
+6
-2
@@ -3,14 +3,18 @@ declare(strict_types=1);
|
||||
|
||||
namespace Ely\CS;
|
||||
|
||||
use Ely\CS\Fixers as ElyFixers;
|
||||
use PhpCsFixer\Config as PhpCsFixerConfig;
|
||||
use PhpCsFixer\ConfigInterface as PhpCsFixerConfigInterface;
|
||||
use PhpCsFixerCustomFixers\Fixers as KubawerlosFixers;
|
||||
|
||||
class Config {
|
||||
|
||||
public static function create(array $overwrittenRules = []): PhpCsFixerConfig {
|
||||
public static function create(array $overwrittenRules = []): PhpCsFixerConfigInterface {
|
||||
return (new PhpCsFixerConfig())
|
||||
->setRiskyAllowed(true)
|
||||
->registerCustomFixers(new Fixers())
|
||||
->registerCustomFixers(new ElyFixers())
|
||||
->registerCustomFixers(new KubawerlosFixers())
|
||||
->setRules(Rules::create($overwrittenRules));
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,11 @@ class Rules {
|
||||
'space_multiple_catch' => 'none',
|
||||
],
|
||||
|
||||
// kubawerlos fixers
|
||||
'PhpCsFixerCustomFixers/multiline_promoted_properties' => [
|
||||
'minimum_number_of_parameters' => 2,
|
||||
],
|
||||
|
||||
// Our custom or extended fixers
|
||||
'Ely/align_multiline_parameters' => [
|
||||
'variables' => false,
|
||||
|
||||
Reference in New Issue
Block a user