Skip to content

Commit 9a8cfe5

Browse files
committed
update normalize directory separator to works on windows
1 parent 3bed335 commit 9a8cfe5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/TicketSwapErrorFormatter.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,17 @@ public static function link(
178178
);
179179
}
180180

181-
private static function trimPath(string $path, $other = '') : string
181+
private static function trimPath(string $path) : string
182182
{
183-
$parts = explode(DIRECTORY_SEPARATOR, $path);
183+
// Normalize to forward slashes for consistent handling across platforms
184+
$normalizedPath = str_replace('\\', '/', $path);
185+
$parts = explode('/', $normalizedPath);
184186
if (count($parts) < 6) {
185187
return $path;
186188
}
187189

188190
return implode(
189-
DIRECTORY_SEPARATOR,
191+
'/',
190192
[
191193
...array_slice($parts, 0, 3),
192194
'...',

0 commit comments

Comments
 (0)