Skip to content

Commit f3762ce

Browse files
committed
fix: do not drop first use statement if on succeeding line from namespace
1 parent 2f991fb commit f3762ce

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/LogicStream/LogicStreamWrapper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ private function checkAndAppendNamespace(
120120
string $originalLine,
121121
):bool {
122122
if($lineNumber > 0) {
123-
if(str_starts_with($line, "namespace")) {
123+
if(str_contains($line, "\tnamespace")) {
124124
$this->contents .= $originalLine;
125125
return true;
126126
}
127+
127128
if($line) {
128129
$namespace = new LogicStreamNamespace($this->path, self::NAMESPACE_PREFIX);
129-
$this->contents .= "namespace $namespace;\t";
130+
$this->contents .= "namespace $namespace;\n$originalLine\t";
130131
return true;
131132
}
132133
}

0 commit comments

Comments
 (0)