From dcaeb777cbd091c63a5bbbecd5336ff1b8e1064d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 11 Dec 2024 13:30:21 +0100 Subject: [PATCH] added Helpers::IsWindows --- src/Utils/Finder.php | 2 +- src/Utils/Helpers.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Utils/Finder.php b/src/Utils/Finder.php index a496528af..91617dadc 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 b3586c16c..21efb2ac7 100644 --- a/src/Utils/Helpers.php +++ b/src/Utils/Helpers.php @@ -14,6 +14,9 @@ class Helpers { + public const IsWindows = PHP_OS_FAMILY === 'Windows'; + + /** * Executes a callback and returns the captured output as a string. */