Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0"
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": ">=4"
Expand Down
10 changes: 4 additions & 6 deletions src/CodeManipulation/Actions/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/CodeManipulation/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
3 changes: 3 additions & 0 deletions src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function clearOpcodeCaches()
}
}

/**
* @deprecated 2.2.0
*/
function generatorsSupported()
{
return version_compare(PHP_VERSION, "5.5", ">=");
Expand Down
4 changes: 0 additions & 4 deletions tests/double-colon-class.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
Compatibility with ::class syntax (https://github.com/antecedent/patchwork/issues/14)

--SKIPIF--
<?php version_compare(PHP_VERSION, "5.5", ">=")
or die("skip because ::class syntax is unsupported in this version of PHP") ?>

--FILE--
<?php

Expand Down
4 changes: 0 additions & 4 deletions tests/generator.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
Generator support is currently excluded: https://github.com/antecedent/patchwork/issues/15

--SKIPIF--
<?php version_compare(PHP_VERSION, "5.5", ">=")
or die("skip because generators are not supported in this version of PHP") ?>

--FILE--
<?php

Expand Down
4 changes: 1 addition & 3 deletions tests/includes/ProxyForInternals.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ static function second($x)
assert(isset($array['original']));

# Aliases
if (version_compare(PHP_VERSION, "7.0", ">=")) {
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();

Expand Down
4 changes: 0 additions & 4 deletions tests/php7-parenthesis-removal-bug.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/147

--SKIPIF--
<?php version_compare(PHP_VERSION, "7.0", ">=")
or die("skip because this bug only occurs in PHP 7+") ?>

--FILE--
<?php

Expand Down
4 changes: 0 additions & 4 deletions tests/php7-use-function.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/63

--SKIPIF--
<?php version_compare(PHP_VERSION, "7.0", ">=")
or die("skip because this bug only occurs in PHP 7") ?>

--FILE--
<?php

Expand Down
4 changes: 0 additions & 4 deletions tests/php71-void-return-type.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/64

--SKIPIF--
<?php version_compare(PHP_VERSION, "7.1", ">=")
or die("skip because this bug only occurs in PHP 7.1") ?>

--FILE--
<?php

Expand Down
4 changes: 0 additions & 4 deletions tests/redefine-new-anonymous-class-parameter.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/127

--SKIPIF--
<?php version_compare(PHP_VERSION, "7.0", ">=")
or die("skip because anonymous classes are only supported since PHP 7") ?>

--FILE--
<?php

Expand Down
8 changes: 0 additions & 8 deletions tests/splat.phpt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/56

--SKIPIF--
<?php

version_compare(PHP_VERSION, "5.6", ">=")
or die("skip because this bug only occurs in PHP 5.6 and up");

?>

--FILE--
<?php

Expand Down
4 changes: 0 additions & 4 deletions tests/strict-types.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/79

--SKIPIF--
<?php version_compare(PHP_VERSION, "7.0", ">=")
or die("skip because strict types were only introduced in PHP 7") ?>

--FILE--
<?php

Expand Down
4 changes: 0 additions & 4 deletions tests/variadics-bug.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/114

--SKIPIF--
<?php version_compare(PHP_VERSION, "5.6", ">=")
or die("skip because variadics are not available until PHP 5.6") ?>

--FILE--
<?php
ini_set('zend.assertions', 1);
Expand Down
4 changes: 0 additions & 4 deletions tests/variadics-ref-bug.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/115

--SKIPIF--
<?php version_compare(PHP_VERSION, "5.6", ">=")
or die("skip because variadics are not available until PHP 5.6") ?>

--FILE--
<?php
ini_set('zend.assertions', 1);
Expand Down
4 changes: 0 additions & 4 deletions tests/void-typed.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
--TEST--
https://github.com/antecedent/patchwork/issues/95

--SKIPIF--
<?php version_compare(PHP_VERSION, "7.1", ">=")
or die("skip because this bug only occurs in PHP 7.1") ?>

--FILE--
<?php
ini_set('zend.assertions', 1);
Expand Down