Skip to content

Commit 2b7aede

Browse files
committed
update some for fs method
1 parent c60330b commit 2b7aede

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Traits/FileSnippetReadTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use function fgets;
2222
use function fopen;
2323
use function fseek;
24+
use function trim;
2425

2526
/**
2627
* Class FileSnippetReadTrait
@@ -149,10 +150,10 @@ public static function getLines5u3d(string $file, int $baseLine = 1): array
149150
public static function readFirstLine(string $filepath): string
150151
{
151152
$file = fopen($filepath, 'rb');
152-
$line = fgets($file);
153+
$line = trim((string)fgets($file));
153154
fclose($file);
154155

155-
return (string)$line;
156+
return $line;
156157
}
157158

158159
/**

0 commit comments

Comments
 (0)