
compact_nullable_typehint
¶Remove extra spaces in a nullable typehint.
Rule is applied only in a PHP 7.1+ environment.
--- Original
+++ New
<?php
-function sample(? string $str): ? string
+function sample(?string $str): ?string
{}
The rule is part of the following rule sets:
Using the @PER rule set will enable the compact_nullable_typehint
rule.
Using the @PSR12 rule set will enable the compact_nullable_typehint
rule.
Using the @PhpCsFixer rule set will enable the compact_nullable_typehint
rule.
Using the @Symfony rule set will enable the compact_nullable_typehint
rule.