Namespace must not contain spacing, comments or PHPDoc.
--- Original
+++ New
<?php
-namespace Foo \ Bar;
+namespace Foo\Bar;
--- Original
+++ New
<?php
-echo foo /* comment */ \ bar();
+echo foo\bar();
The rule is part of the following rule sets:
- @PHP80Migration
- @PHP81Migration
- @PHP82Migration
- @PHP83Migration
- @PHP84Migration
- @PhpCsFixer
- @Symfony
- Fixer class: PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer
- Test class: PhpCsFixer\Tests\Fixer\NamespaceNotation\CleanNamespaceFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.