Skip to content

Commit 8e0f822

Browse files
committed
minor symfony#14567 [Filesystem] Simplify if statement (kix)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes symfony#14567). Discussion ---------- [Filesystem] Simplify if statement | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none Simplified the `if` statement if `Symfony\Component\Filesystem\Filesystem::isAbsolutePath` Commits ------- 4d974ce [Filesystem] Simplified an if statement
2 parents cbcdb16 + 4d974ce commit 8e0f822

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,17 +423,13 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o
423423
*/
424424
public function isAbsolutePath($file)
425425
{
426-
if (strspn($file, '/\\', 0, 1)
426+
return (strspn($file, '/\\', 0, 1)
427427
|| (strlen($file) > 3 && ctype_alpha($file[0])
428428
&& substr($file, 1, 1) === ':'
429429
&& (strspn($file, '/\\', 2, 1))
430430
)
431431
|| null !== parse_url($file, PHP_URL_SCHEME)
432-
) {
433-
return true;
434-
}
435-
436-
return false;
432+
);
437433
}
438434

439435
/**

0 commit comments

Comments
 (0)