
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