Skip to content

[Feature] Insert a space after the fn keyword for arrow functions #414

Open
@hirasso

Description

@hirasso

Is your feature request related to a problem?

Not really. It's more of a "nice to have". I'd like phpcbf to format my arrow functions from this:

$ids = array_map(fn($entity) => $entity->getId(), $entities);

to this (note the space after the fn keyword):

$ids = array_map(fn ($entity) => $entity->getId(), $entities);

Describe the solution you'd like

Maybe there already is a rule for this? When I google it, I'm only able to find this resolved issue on the PHP CS Fixer repo.

Additional context (optional)

  • if I would know the ins and outs of PHP_CodeSniffer, I'd certainly propose a PR. But I'm only beginning to use it...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions