Fork me on GitHub
a Sensio Labs Product

BoY42 (v3.15.1) edition

Rule function_typehint_space

Ensure single space between function’s argument and its typehint.

Examples

Example #1

--- Original
+++ New
 <?php
-function sample(array$a)
+function sample(array $a)
 {}

Example #2

--- Original
+++ New
 <?php
-function sample(array  $a)
+function sample(array $a)
 {}

Rule sets

The rule is part of the following rule sets:

@PhpCsFixer

Using the @PhpCsFixer rule set will enable the function_typehint_space rule.

@Symfony

Using the @Symfony rule set will enable the function_typehint_space rule.

The logo is © 2010-2022 Sensio Labs