Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit a0edf13

Browse files
committed
Fix an existing 5607 lint error
1 parent 114a57a commit a0edf13

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/Migrations/AddXHPChildrenDeclarationMethodMigration.hack

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,14 @@ final class AddXHPChildrenDeclarationMethodMigration
4343
$before = C\firstx($decls->getChildrenByType<IDeclaration>());
4444
$t = $before->getFirstTokenx();
4545
$use = self::getUseNamespace();
46-
if ($t->getLeading() !== $t->getLeadingWhitespace()) {
47-
$ut = $use->getFirstTokenx();
48-
return $in->withDeclarations(
49-
$in->getDeclarations()->insertBefore(
50-
$before,
51-
$use->replace($ut, $ut->withLeading($t->getLeading())),
52-
),
53-
)
54-
->replace($t, $t->withLeading(null));
55-
}
46+
$ut = $use->getFirstTokenx();
5647
return $in->withDeclarations(
57-
$decls->insertBefore($before, self::getUseNamespace()),
58-
);
48+
$in->getDeclarations()->insertBefore(
49+
$before,
50+
$use->replace($ut, $ut->withLeading($t->getLeading())),
51+
),
52+
)
53+
->replace($t, $t->withLeading(null));
5954
}
6055

6156
private static function addUseNamespaceToNamespaceBlock(

0 commit comments

Comments
 (0)