Fork me on GitHub
a Sensio Labs Product

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

Rule compact_nullable_typehintΒΆ

Remove extra spaces in a nullable typehint.

DescriptionΒΆ

Rule is applied only in a PHP 7.1+ environment.

WarningΒΆ

This rule is deprecated and will be removed in the next major versionΒΆ

You should use compact_nullable_type_declaration instead.

ExamplesΒΆ

Example #1ΒΆ

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

Source classΒΆ

PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer