Skip to content

Commit

Permalink
Fix POSIX only detection of absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rarila authored Nov 23, 2023
1 parent baa6d5d commit 2d09104
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Psalm/Config/FileFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use SimpleXMLElement;
use Symfony\Component\Filesystem\Path;

use function array_filter;
use function array_map;
Expand Down Expand Up @@ -127,7 +128,7 @@ public static function loadFromArray(
$resolve_symlinks = (bool) ($directory['resolveSymlinks'] ?? false);
$declare_strict_types = (bool) ($directory['useStrictTypes'] ?? false);

if ($directory_path[0] === '/' && DIRECTORY_SEPARATOR === '/') {
if (Path::isAbsolute($directory_path)) {
/** @var non-empty-string */
$prospective_directory_path = $directory_path;
} else {
Expand Down

0 comments on commit 2d09104

Please sign in to comment.