Browse Source

Fix blank line removed before declare statement

Julien Falque 7 years ago
parent
commit
f893c9afff

+ 1 - 0
src/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixer.php

@@ -79,6 +79,7 @@ class Bar {}
             T_GOTO,
             T_CONTINUE,
             T_BREAK,
+            T_DECLARE,
         );
 
         foreach ($tokens as $index => $token) {

+ 14 - 0
tests/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixerTest.php

@@ -130,6 +130,20 @@ EOF;
         $this->doTest($input);
     }
 
+    public function testLineBeforeDeclareIsNotBeRemoved()
+    {
+        $expected = <<<'EOF'
+<?php
+/**
+ * This is some license header.
+ */
+
+declare(strict_types=1);
+EOF;
+
+        $this->doTest($expected);
+    }
+
     public function testFixesSimpleClass()
     {
         $expected = <<<'EOF'