Skip to content

Commit a3646f7

Browse files
minor symfony#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 ------- 0d107cf Use PHP_OS_FAMILY if possible
2 parents 0cc054c + 0d107cf commit a3646f7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Component/Console/Helper/SymfonyQuestionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function writeError(OutputInterface $output, \Exception $error)
100100

101101
private function getEofShortcut(): string
102102
{
103-
if (false !== strpos(\PHP_OS, 'WIN')) {
103+
if ('Windows' === \PHP_OS_FAMILY) {
104104
return '<comment>Ctrl+Z</comment> then <comment>Enter</comment>';
105105
}
106106

src/Symfony/Component/Console/Tests/Helper/SymfonyQuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function testAskMultilineQuestionIncludesHelpText()
218218
{
219219
$expected = 'Write an essay (press Ctrl+D to continue)';
220220

221-
if (false !== strpos(\PHP_OS, 'WIN')) {
221+
if ('Windows' === \PHP_OS_FAMILY) {
222222
$expected = 'Write an essay (press Ctrl+Z then Enter to continue)';
223223
}
224224

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function __construct(callable $classLoader)
208208
} elseif (substr($test, -\strlen($file)) === $file) {
209209
// filesystem is case insensitive and realpath() normalizes the case of characters
210210
self::$caseCheck = 1;
211-
} elseif (false !== stripos(\PHP_OS, 'darwin')) {
211+
} elseif ('Darwin' === \PHP_OS_FAMILY) {
212212
// on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
213213
self::$caseCheck = 2;
214214
} else {

0 commit comments

Comments
 (0)