From 58cabb2070f064d7e52ceabb3430fe21138f2a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Thu, 31 Oct 2019 00:31:17 +0100 Subject: [PATCH] Bump dependencies (#443) --- composer.json | 4 ++-- requirement-checker/composer.lock | 24 +++++++++---------- requirement-checker/expected_terminal_diff | 6 ++--- requirement-checker/src/Terminal.php | 28 +++++++++++++++++++++- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index c53aa6d89..e3c496e77 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "composer/semver": "^1.5", "composer/xdebug-handler": "^1.3.2", "hoa/compiler": "^3.17", - "humbug/php-scoper": "~0.12", + "humbug/php-scoper": "^0.12", "justinrainbow/json-schema": "^5.2.9", "nikic/iter": "^2.0", "nikic/php-parser": "^4.2", @@ -56,7 +56,7 @@ "phpseclib/phpseclib": "^2.0", "psr/log": "^1.0", "seld/jsonlint": "^1.7", - "symfony/console": "^4.2", + "symfony/console": "^4.3.5", "symfony/filesystem": "^4.2", "symfony/finder": "^4.0", "symfony/process": "^4.2", diff --git a/requirement-checker/composer.lock b/requirement-checker/composer.lock index 49f490c70..8ee38eb99 100644 --- a/requirement-checker/composer.lock +++ b/requirement-checker/composer.lock @@ -428,22 +428,22 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://github.com/gitapi/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -487,7 +487,7 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -743,16 +743,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.3.5", + "version": "8.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "302faed7059fde575cf3403a78c730c5e3a62750" + "reference": "a142a7e66c0ea7b5b6c04ee27f08d10d1137cd9b" }, "dist": { "type": "zip", - "url": "https://github.com/gitapi/repos/sebastianbergmann/phpunit/zipball/302faed7059fde575cf3403a78c730c5e3a62750", - "reference": "302faed7059fde575cf3403a78c730c5e3a62750", + "url": "https://github.com/gitapi/repos/sebastianbergmann/phpunit/zipball/a142a7e66c0ea7b5b6c04ee27f08d10d1137cd9b", + "reference": "a142a7e66c0ea7b5b6c04ee27f08d10d1137cd9b", "shasum": "" }, "require": { @@ -796,7 +796,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.3-dev" + "dev-master": "8.4-dev" } }, "autoload": { @@ -822,7 +822,7 @@ "testing", "xunit" ], - "time": "2019-09-14T09:12:03+00:00" + "time": "2019-10-28T10:39:51+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", diff --git a/requirement-checker/expected_terminal_diff b/requirement-checker/expected_terminal_diff index d4d819fc9..965e2d056 100644 --- a/requirement-checker/expected_terminal_diff +++ b/requirement-checker/expected_terminal_diff @@ -24,11 +24,11 @@ > * > * @license MIT (c) Fabien Potencier > */ -96c103 +122c129 < return [(int) $matches[2], (int) $matches[1]]; --- > return array((int) $matches[2], (int) $matches[1]); -120,123c127,130 +146,149c153,156 < $descriptorspec = [ < 1 => ['pipe', 'w'], < 2 => ['pipe', 'w'], @@ -38,7 +38,7 @@ > 1 => array('pipe', 'w'), > 2 => array('pipe', 'w'), > ); -125c132 +151c158 < $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); --- > $process = proc_open($command, $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); diff --git a/requirement-checker/src/Terminal.php b/requirement-checker/src/Terminal.php index 483261835..a79807837 100644 --- a/requirement-checker/src/Terminal.php +++ b/requirement-checker/src/Terminal.php @@ -22,6 +22,7 @@ class Terminal { private static $width; private static $height; + private static $stty; /** * Gets the terminal width. @@ -61,6 +62,22 @@ public function getHeight() return self::$height ?: 50; } + /** + * @internal + * + * @return bool + */ + public static function hasSttyAvailable() + { + if (null !== self::$stty) { + return self::$stty; + } + + exec('stty 2>&1', $output, $exitcode); + + return self::$stty = 0 === $exitcode; + } + private static function initDimensions() { if ('\\' === \DIRECTORY_SEPARATOR) { @@ -69,12 +86,21 @@ private static function initDimensions() // or [w, h] from "wxh" self::$width = (int) $matches[1]; self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; + } elseif (self::hasSttyAvailable()) { + self::initDimensionsUsingStty(); } elseif (null !== $dimensions = self::getConsoleMode()) { // extract [w, h] from "wxh" self::$width = (int) $dimensions[0]; self::$height = (int) $dimensions[1]; } - } elseif ($sttyString = self::getSttyColumns()) { + } else { + self::initDimensionsUsingStty(); + } + } + + private static function initDimensionsUsingStty() + { + if ($sttyString = self::getSttyColumns()) { if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { // extract [w, h] from "rows h; columns w;" self::$width = (int) $matches[2];