2

I am looking for a PHP CS Fixer rule that requires a single space after a named argument, going from this:

array_key_exists(
    key:'test',
    array:$array,
);

to this:

array_key_exists(
    key: 'test',
    array: $array,
);

Any ideas?

DarkBee
  • 16,592
  • 6
  • 46
  • 58
Keith Brink
  • 139
  • 11

1 Answers1

1

Rule single_space_after_construct is what you are looking for, it has an option named_argument which is enabled by default.

So either use it with default (true in config) or add named_argument to constructs array.

kuba
  • 3,670
  • 3
  • 31
  • 41