Skip to content

Commit

Permalink
added Helpers::isWindows()
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 11, 2024
1 parent f40d333 commit 9b0cba1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '');
}
}
9 changes: 9 additions & 0 deletions src/Utils/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 9b0cba1

Please sign in to comment.