Fork me on GitHub
a Sensio Labs Product

I ate three cookies πŸͺ (v3.40.2) edition

Rule compact_nullable_type_declarationΒΆ

Remove extra spaces in a nullable type declaration.

DescriptionΒΆ

Rule is applied only in a PHP 7.1+ environment.

ExamplesΒΆ

Example #1ΒΆ

--- Original
+++ New
 <?php
-function sample(? string $str): ? string
+function sample(?string $str): ?string
 {}

Rule setsΒΆ

The rule is part of the following rule sets:

Source classΒΆ

PhpCsFixer\Fixer\Whitespace\CompactNullableTypeDeclarationFixer