Skip to content

Commit 9b0cba1

Browse files
committed
added Helpers::isWindows()
1 parent f40d333 commit 9b0cba1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Utils/Finder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,6 @@ private function buildPattern(string $mask): string
505505
'\-' => '-',
506506
],
507507
);
508-
return '#' . $anchor . $pattern . '$#D' . (defined('PHP_WINDOWS_VERSION_BUILD') ? 'i' : '');
508+
return '#' . $anchor . $pattern . '$#D' . (Helpers::isWindows() ? 'i' : '');
509509
}
510510
}

src/Utils/Helpers.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ public static function falseToNull(mixed $value): mixed
5252
}
5353

5454

55+
/**
56+
* Determines if the script is running on a Windows operating system.
57+
*/
58+
public static function isWindows(): bool
59+
{
60+
return defined('PHP_WINDOWS_VERSION_BUILD');
61+
}
62+
63+
5564
/**
5665
* Returns value clamped to the inclusive range of min and max.
5766
*/

0 commit comments

Comments
 (0)