diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b649a77..e806e56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,10 +7,6 @@ jobs: fail-fast: false matrix: php-versions: - - '5.4' - - '5.5' - - '5.6' - - '7.0' - '7.1' - '7.2' - '7.3' diff --git a/composer.json b/composer.json index 50863aa..5d54aa8 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "minimum-stability": "stable", "require": { - "php": ">=5.4.0" + "php": ">=7.1.0" }, "require-dev": { "phpunit/phpunit": ">=4" diff --git a/src/CodeManipulation/Actions/Generic.php b/src/CodeManipulation/Actions/Generic.php index 78617e5..b2de56e 100644 --- a/src/CodeManipulation/Actions/Generic.php +++ b/src/CodeManipulation/Actions/Generic.php @@ -57,12 +57,10 @@ function prependCodeToFunctions($code, $typedVariants = array(), $fillArgRefs = $argRefs = Arguments\constructReferenceArray($args); } $bracket = $s->next(LEFT_CURLY, $function); - if (Utils\generatorsSupported()) { - # Skip generators - $yield = $s->next(T_YIELD, $bracket); - if ($yield < $s->match($bracket)) { - continue; - } + # Skip generators + $yield = $s->next(T_YIELD, $bracket); + if ($yield < $s->match($bracket)) { + continue; } $semicolon = $s->next(SEMICOLON, $function); if ($bracket < $semicolon) { diff --git a/src/CodeManipulation/Stream.php b/src/CodeManipulation/Stream.php index 2fa8d78..9167b99 100644 --- a/src/CodeManipulation/Stream.php +++ b/src/CodeManipulation/Stream.php @@ -59,7 +59,7 @@ public function stream_open($path, $mode, $options, &$openedPath) { $including = (bool) ($options & self::STREAM_OPEN_FOR_INCLUDE); - // In PHP 7 and 8, `parse_ini_file()` also sets STREAM_OPEN_FOR_INCLUDE. + // `parse_ini_file()` also sets STREAM_OPEN_FOR_INCLUDE. if ($including) { $frame = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]; if (empty($frame['class']) && $frame['function'] === 'parse_ini_file') { diff --git a/src/Utils.php b/src/Utils.php index aa8a681..6274c50 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -32,6 +32,9 @@ function clearOpcodeCaches() } } +/** + * @deprecated 2.2.0 + */ function generatorsSupported() { return version_compare(PHP_VERSION, "5.5", ">="); diff --git a/tests/double-colon-class.phpt b/tests/double-colon-class.phpt index 0d5b290..0e96dd5 100644 --- a/tests/double-colon-class.phpt +++ b/tests/double-colon-class.phpt @@ -1,10 +1,6 @@ --TEST-- Compatibility with ::class syntax (https://github.com/antecedent/patchwork/issues/14) ---SKIPIF-- -=") - or die("skip because ::class syntax is unsupported in this version of PHP") ?> - --FILE-- =") - or die("skip because generators are not supported in this version of PHP") ?> - --FILE-- =")) { - eval('use function strtolower as toLower; assert(toLower("X") === "X, but in lowercase");'); -} +eval('use function strtolower as toLower; assert(toLower("X") === "X, but in lowercase");'); p\restoreAll(); diff --git a/tests/php7-parenthesis-removal-bug.phpt b/tests/php7-parenthesis-removal-bug.phpt index 86c2df8..fae1ea0 100644 --- a/tests/php7-parenthesis-removal-bug.phpt +++ b/tests/php7-parenthesis-removal-bug.phpt @@ -1,10 +1,6 @@ --TEST-- https://github.com/antecedent/patchwork/issues/147 ---SKIPIF-- -=") - or die("skip because this bug only occurs in PHP 7+") ?> - --FILE-- =") - or die("skip because this bug only occurs in PHP 7") ?> - --FILE-- =") - or die("skip because this bug only occurs in PHP 7.1") ?> - --FILE-- =") - or die("skip because anonymous classes are only supported since PHP 7") ?> - --FILE-- =") - or die("skip because this bug only occurs in PHP 5.6 and up"); - -?> - --FILE-- =") - or die("skip because strict types were only introduced in PHP 7") ?> - --FILE-- =") - or die("skip because variadics are not available until PHP 5.6") ?> - --FILE-- =") - or die("skip because variadics are not available until PHP 5.6") ?> - --FILE-- =") - or die("skip because this bug only occurs in PHP 7.1") ?> - --FILE--