From d2f6d145ac5f65d2cb3cfe901abd382a10ea39a6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 Jun 2018 17:37:42 +0200 Subject: [PATCH] Use PHP_OS_FAMILY constant thanks to Symfony's PHP 7.2 polyfill --- composer.json | 1 + composer.lock | 112 +++++++++++++-------------- tests/Command/AddUserCommandTest.php | 4 +- 3 files changed, 58 insertions(+), 59 deletions(-) diff --git a/composer.json b/composer.json index 1ea275df4..2b58cef8d 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "symfony/form": "^4.1", "symfony/framework-bundle": "^4.1", "symfony/monolog-bundle": "^3.1", + "symfony/polyfill-php72": "^1.8", "symfony/security-bundle": "^4.1", "symfony/swiftmailer-bundle": "^3.1", "symfony/translation": "^4.1", diff --git a/composer.lock b/composer.lock index 20cf2970f..1588e74df 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f28e3f33ef8e45f298514faf697fac3d", + "content-hash": "f15e4f7f83bfa577f980f2d6a64f87d2", "packages": [ { "name": "composer/ca-bundle", @@ -3354,6 +3354,61 @@ ], "time": "2018-04-26T10:06:28+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, { "name": "symfony/property-access", "version": "v4.1.1", @@ -5274,61 +5329,6 @@ ], "time": "2018-04-26T10:06:28+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", - "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-04-26T10:06:28+00:00" - }, { "name": "symfony/process", "version": "v4.1.1", diff --git a/tests/Command/AddUserCommandTest.php b/tests/Command/AddUserCommandTest.php index cdbc47ecc..079b231aa 100644 --- a/tests/Command/AddUserCommandTest.php +++ b/tests/Command/AddUserCommandTest.php @@ -33,9 +33,7 @@ protected function setUp() exec('stty 2>&1', $output, $exitcode); $isSttySupported = 0 === $exitcode; - $isWindows = '\\' === \DIRECTORY_SEPARATOR; - - if ($isWindows || !$isSttySupported) { + if ('Windows' === PHP_OS_FAMILY || !$isSttySupported) { $this->markTestSkipped('`stty` is required to test this command.'); } }