Skip to content

Commit 698728a

Browse files
tigitznicolas-grekas
authored andcommitted
Leverage arrow function syntax for closure
1 parent 50b2523 commit 698728a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Filesystem.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,9 @@ public function makePathRelative(string $endPath, string $startPath): string
438438
$startPath = str_replace('\\', '/', $startPath);
439439
}
440440

441-
$splitDriveLetter = function ($path) {
442-
return (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0]))
443-
? [substr($path, 2), strtoupper($path[0])]
444-
: [$path, null];
445-
};
441+
$splitDriveLetter = fn ($path) => (\strlen($path) > 2 && ':' === $path[1] && '/' === $path[2] && ctype_alpha($path[0]))
442+
? [substr($path, 2), strtoupper($path[0])]
443+
: [$path, null];
446444

447445
$splitPath = function ($path) {
448446
$result = [];

0 commit comments

Comments
 (0)