minor #42083 Use PHP_OS_FAMILY if possible (javiereguiluz)

This PR was submitted for the 5.4 branch but it was merged into the 5.2 branch instead.

Discussion
----------

Use PHP_OS_FAMILY if possible

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This constant was introduced in PHP 7.2: https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family

~This is not a bug, so if you decide to merge, it should be in 5.4 branch I guess.~

Commits
-------

0d107cf2c0 Use PHP_OS_FAMILY if possible
This commit is contained in:
Nicolas Grekas 2021-07-13 12:04:36 +02:00
commit a3646f7357
3 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class SymfonyQuestionHelper extends QuestionHelper
private function getEofShortcut(): string
{
if (false !== strpos(\PHP_OS, 'WIN')) {
if ('Windows' === \PHP_OS_FAMILY) {
return '<comment>Ctrl+Z</comment> then <comment>Enter</comment>';
}

View File

@ -218,7 +218,7 @@ EOT
{
$expected = 'Write an essay (press Ctrl+D to continue)';
if (false !== strpos(\PHP_OS, 'WIN')) {
if ('Windows' === \PHP_OS_FAMILY) {
$expected = 'Write an essay (press Ctrl+Z then Enter to continue)';
}

View File

@ -208,7 +208,7 @@ class DebugClassLoader
} elseif (substr($test, -\strlen($file)) === $file) {
// filesystem is case insensitive and realpath() normalizes the case of characters
self::$caseCheck = 1;
} elseif (false !== stripos(\PHP_OS, 'darwin')) {
} elseif ('Darwin' === \PHP_OS_FAMILY) {
// on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
self::$caseCheck = 2;
} else {