Search code examples
phpcoding-style

PHP Code Style Fixer: put space between colon and method's return type


Is there a PHP CS Fixer fixer available that will put space between colon and return type? Fixer should correct this signature:

public function modifyFeatureFlags(array $feature_flags):array
{
}

to:

public function modifyFeatureFlags(array $feature_flags): array
{
}

The list of available fixers is long, and I have hard time finding the correct one.


Solution

  • From README.md

    return_type_declaration [@Symfony]

    There should be one or no space before colon and one space after it in return type declaration.

    Try it out