Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump PHP version to 7.4 #7291

Merged
merged 4 commits into from Jan 4, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
tools: composer:v2
coverage: none

Expand Down
17 changes: 7 additions & 10 deletions composer.json
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^7.1|^8",
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-dom": "*",
Expand All @@ -28,12 +28,12 @@
"composer/semver": "^1.4 || ^2.0 || ^3.0",
"composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0",
"dnoegel/php-xdg-base-dir": "^0.1.1",
"felixfbecker/advanced-json-rpc": "^3.0.3",
"felixfbecker/advanced-json-rpc": "^3.1",
"felixfbecker/language-server-protocol": "^1.5",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.13",
"openlss/lib-array2xml": "^1.0",
"sebastian/diff": "^3.0 || ^4.0",
"sebastian/diff": "^4.0",
"symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0",
"webmozart/path-util": "^2.3"
},
Expand All @@ -42,16 +42,16 @@
},
"require-dev": {
"ext-curl": "*",
"bamarni/composer-bin-plugin": "^1.2",
"bamarni/composer-bin-plugin": "^1.4",
"brianium/paratest": "^4.0||^6.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpdocumentor/reflection-docblock": "^5",
"phpmyadmin/sql-parser": "5.1.0||dev-master",
"phpspec/prophecy": ">=1.9.0",
"phpspec/prophecy": ">=1.10.2",
"phpunit/phpunit": "^9.0",
"psalm/plugin-phpunit": "^0.16.1",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5",
"squizlabs/php_codesniffer": "^3.6",
"symfony/process": "^4.3 || ^5.0 || ^6.0",
"weirdan/prophecy-shim": "^1.0 || ^2.0"
},
Expand Down Expand Up @@ -80,10 +80,7 @@
"autoload": {
"psr-4": {
"Psalm\\": "src/Psalm/"
},
"files": [
"src/spl_object_id.php"
]
}
},
"autoload-dev": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion psalm.xml.dist
Expand Up @@ -34,7 +34,6 @@
<file name="src/Psalm/Internal/PhpTraverser/CustomTraverser.php"/>
<file name="tests/ErrorBaselineTest.php"/>
<file name="vendor/symfony/console/Command/Command.php"/>
<file name="src/spl_object_id.php"/>
<directory name="tests/fixtures"/>
<file name="vendor/felixfbecker/advanced-json-rpc/lib/Dispatcher.php" />
<directory name="vendor/netresearch/jsonmapper" />
Expand Down
54 changes: 0 additions & 54 deletions src/spl_object_id.php

This file was deleted.

16 changes: 8 additions & 8 deletions tests/ClosureTest.php
Expand Up @@ -330,7 +330,7 @@ public function callTheInvokableIndirectly(): bool {
}
}',
],
'PHP71-mirrorCallableParams' => [
'mirrorCallableParams' => [
'<?php
namespace NS;
use Closure;
Expand All @@ -357,7 +357,7 @@ function(int $i) : void {
[1, 2, 3]
);',
],
'PHP71-closureFromCallableInvokableNamedClass' => [
'closureFromCallableInvokableNamedClass' => [
'<?php
namespace NS;
use Closure;
Expand All @@ -373,7 +373,7 @@ public function __invoke(int $p): bool {

acceptsIntToBool(Closure::fromCallable(new NamedInvokable));',
],
'PHP71-closureFromCallableInvokableAnonymousClass' => [
'closureFromCallableInvokableAnonymousClass' => [
'<?php
namespace NS;
use Closure;
Expand All @@ -389,7 +389,7 @@ public function __invoke(int $p):bool {

acceptsIntToBool(Closure::fromCallable($anonInvokable));',
],
'PHP71-publicCallableFromInside' => [
'publicCallableFromInside' => [
'<?php
class Base {
public function publicMethod() : void {}
Expand All @@ -401,7 +401,7 @@ public function test() : Closure {
}
}',
],
'PHP71-protectedCallableFromInside' => [
'protectedCallableFromInside' => [
'<?php
class Base {
protected function protectedMethod() : void {}
Expand All @@ -413,7 +413,7 @@ public function test() : Closure {
}
}',
],
'PHP71-closureFromCallableNamedFunction' => [
'closureFromCallableNamedFunction' => [
'<?php
$closure = Closure::fromCallable("strlen");
',
Expand Down Expand Up @@ -965,7 +965,7 @@ function(int $i) : void {
}',
'error_message' => 'TypeDoesNotContainType',
],
'PHP71-closureFromCallableInvokableNamedClassWrongArgs' => [
'closureFromCallableInvokableNamedClassWrongArgs' => [
'<?php
namespace NS;
use Closure;
Expand Down Expand Up @@ -999,7 +999,7 @@ public function __construct(UndefinedClass $o) {}
};',
'error_message' => 'DuplicateParam',
],
'PHP71-privateCallable' => [
'privateCallable' => [
'<?php
class Base {
private function privateMethod() : void {}
Expand Down
12 changes: 6 additions & 6 deletions tests/FunctionCallTest.php
Expand Up @@ -1032,7 +1032,7 @@ class Props {
'$c' => 'int',
],
],
'PHP73-hrtime' => [
'hrtime' => [
'<?php
$a = hrtime(true);
$b = hrtime();
Expand All @@ -1046,7 +1046,7 @@ class Props {
'$d' => 'array{0: int, 1: int}',
],
],
'PHP73-hrtimeCanBeFloat' => [
'hrtimeCanBeFloat' => [
'<?php
$a = hrtime(true);

Expand Down Expand Up @@ -1239,7 +1239,7 @@ function baz(string $s) : void {
/** @psalm-suppress TooFewArguments */
min(0);',
],
'PHP73-allowIsCountableToInformType' => [
'allowIsCountableToInformType' => [
'<?php
function getObject() : iterable{
return [];
Expand Down Expand Up @@ -1345,15 +1345,15 @@ function takesInt(int $i) : void {}
'$matches===' => 'array<array-key, array{string, int}>',
],
],
'PHP72-pregMatchWithFlagUnmatchedAsNull' => [
'pregMatchWithFlagUnmatchedAsNull' => [
'<?php
$r = preg_match("{foo}", "foo", $matches, PREG_UNMATCHED_AS_NULL);',
'assertions' => [
'$r===' => '0|1|false',
'$matches===' => 'array<array-key, null|string>',
],
],
'PHP72-pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [
'pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [
'<?php
$r = preg_match("{foo}", "foo", $matches, PREG_OFFSET_CAPTURE | PREG_UNMATCHED_AS_NULL);',
'assertions' => [
Expand Down Expand Up @@ -1399,7 +1399,7 @@ function foo(int $a, string $b, bool $c) : array {
return compact("a", "b", "c");
}',
],
'PHP73-setCookiePhp73' => [
'setCookiePhp73' => [
'<?php
setcookie(
"name",
Expand Down
6 changes: 1 addition & 5 deletions tests/Traits/InvalidCodeAnalysisTestTrait.php
Expand Up @@ -42,11 +42,7 @@ public function testInvalidCode(
string $php_version = '7.3'
): void {
$test_name = $this->getTestName();
if (strpos($test_name, 'PHP71-') !== false) {
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
$this->markTestSkipped('Test case requires PHP 7.1.');
}
} elseif (strpos($test_name, 'PHP80-') !== false) {
if (strpos($test_name, 'PHP80-') !== false) {
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
$this->markTestSkipped('Test case requires PHP 8.0.');
}
Expand Down
14 changes: 1 addition & 13 deletions tests/Traits/ValidCodeAnalysisTestTrait.php
Expand Up @@ -39,19 +39,7 @@ public function testValidCode(
string $php_version = '7.3'
): void {
$test_name = $this->getTestName();
if (strpos($test_name, 'PHP71-') !== false) {
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
$this->markTestSkipped('Test case requires PHP 7.1.');
}
} elseif (strpos($test_name, 'PHP72-') !== false) {
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
$this->markTestSkipped('Test case requires PHP 7.2.');
}
} elseif (strpos($test_name, 'PHP73-') !== false) {
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
$this->markTestSkipped('Test case requires PHP 7.3.');
}
} elseif (strpos($test_name, 'PHP80-') !== false) {
if (strpos($test_name, 'PHP80-') !== false) {
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
$this->markTestSkipped('Test case requires PHP 8.0.');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TypeReconciliation/ConditionalTest.php
Expand Up @@ -1006,7 +1006,7 @@ function f() { return rand(0,1) ? "f" : 1.1; }
atan($a);
atan($b);',
],
'PHP71-removeNonCallable' => [
'removeNonCallable' => [
'<?php
$f = rand(0, 1) ? "strlen" : 1.1;
if (is_callable($f)) {
Expand Down