Skip to content

Commit 9640a31

Browse files
committed
bug #4911 PhpdocSeparationFixer - fix regression with lack of next line (keradus)
This PR was submitted for the 2.16 branch but it was squashed and merged into the 2.15 branch instead (closes #4911). Discussion ---------- PhpdocSeparationFixer - fix regression with lack of next line Commits ------- 323c594 PhpdocSeparationFixer - fix regression with lack of next line
2 parents c86164c + 323c594 commit 9640a31

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Fixer/Phpdoc/PhpdocSeparationFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function fixDescription(DocBlock $doc)
102102
if ($line->containsUsefulContent()) {
103103
$next = $doc->getLine($index + 1);
104104

105-
if ($next->containsATag()) {
105+
if (null !== $next && $next->containsATag()) {
106106
$line->addBlank();
107107

108108
break;

tests/Fixer/Phpdoc/PhpdocSeparationFixerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,18 @@ public function testLargerEmptyDocBlock()
573573
*
574574
*/
575575

576+
EOF;
577+
578+
$this->doTest($expected);
579+
}
580+
581+
public function testOneLineDocBlock()
582+
{
583+
$expected = <<<'EOF'
584+
<?php
585+
/** Foo */
586+
const Foo = 1;
587+
576588
EOF;
577589

578590
$this->doTest($expected);

0 commit comments

Comments
 (0)