diff --git a/src/Utils/Finder.php b/src/Utils/Finder.php index a496528a..841c2878 100644 --- a/src/Utils/Finder.php +++ b/src/Utils/Finder.php @@ -505,6 +505,6 @@ private function buildPattern(string $mask): string '\-' => '-', ], ); - return '#' . $anchor . $pattern . '$#D' . (defined('PHP_WINDOWS_VERSION_BUILD') ? 'i' : ''); + return '#' . $anchor . $pattern . '$#D' . (Helpers::isWindows() ? 'i' : ''); } } diff --git a/src/Utils/Helpers.php b/src/Utils/Helpers.php index b3586c16..9ca59901 100644 --- a/src/Utils/Helpers.php +++ b/src/Utils/Helpers.php @@ -52,6 +52,15 @@ public static function falseToNull(mixed $value): mixed } + /** + * Determines if the script is running on a Windows operating system. + */ + public static function isWindows(): bool + { + return defined('PHP_WINDOWS_VERSION_BUILD'); + } + + /** * Returns value clamped to the inclusive range of min and max. */