============================= Rule ``function_declaration`` ============================= Spaces should be properly placed in a function declaration. Configuration ------------- ``closure_function_spacing`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Spacing to use before open parenthesis for closures. Allowed values: ``'none'`` and ``'one'`` Default value: ``'one'`` ``closure_fn_spacing`` ~~~~~~~~~~~~~~~~~~~~~~ Spacing to use before open parenthesis for short arrow functions. Allowed values: ``'none'`` and ``'one'`` Default value: ``'one'`` ``trailing_comma_single_line`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether trailing commas are allowed in single line signatures. Allowed types: ``bool`` Default value: ``false`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New 'none']``. .. code-block:: diff --- Original +++ New 'none']``. .. code-block:: diff --- Original +++ New null; +$f = fn() => null; Rule sets --------- The rule is part of the following rule sets: - `@PER <./../../ruleSets/PER.rst>`_ - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_ - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_ - `@PSR2 <./../../ruleSets/PSR2.rst>`_ - `@PSR12 <./../../ruleSets/PSR12.rst>`_ - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ - `@Symfony <./../../ruleSets/Symfony.rst>`_