Skip to content

Commit c5254cd

Browse files
javiereguiluznicolas-grekas
authored andcommitted
Code updates
1 parent 7da8ea2 commit c5254cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Path.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,13 @@ public static function changeExtension(string $path, string $extension): string
346346
$extension = ltrim($extension, '.');
347347

348348
// No extension for paths
349-
if ('/' === substr($path, -1)) {
349+
if (str_ends_with($path, '/')) {
350350
return $path;
351351
}
352352

353353
// No actual extension in path
354354
if (empty($actualExtension)) {
355-
return $path.('.' === substr($path, -1) ? '' : '.').$extension;
355+
return $path.(str_ends_with($path, '.') ? '' : '.').$extension;
356356
}
357357

358358
return substr($path, 0, -\strlen($actualExtension)).$extension;

0 commit comments

Comments
 (0)