diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8ae030d4f46..b9b7d2edcfc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -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
diff --git a/composer.json b/composer.json
index 67e1687a34e..6cc57bf5284 100644
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,7 @@
}
],
"require": {
- "php": "^7.1|^8",
+ "php": "^7.4 || ~8.0.0 || ~8.1.0",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-dom": "*",
@@ -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"
},
@@ -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"
},
@@ -80,10 +80,7 @@
"autoload": {
"psr-4": {
"Psalm\\": "src/Psalm/"
- },
- "files": [
- "src/spl_object_id.php"
- ]
+ }
},
"autoload-dev": {
"psr-4": {
diff --git a/psalm.xml.dist b/psalm.xml.dist
index 0343b7cb1fc..c1ddfa58bf3 100644
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -34,7 +34,6 @@
-
diff --git a/src/spl_object_id.php b/src/spl_object_id.php
deleted file mode 100644
index 8b30da94ab3..00000000000
--- a/src/spl_object_id.php
+++ /dev/null
@@ -1,54 +0,0 @@
-isUserDefined()) {
- /**
- * See https://github.com/runkit7/runkit_object_id for a faster native version for php <= 7.1
- *
- * @param object $object
- * @return int The object id
- */
- function spl_object_id($object): int
- {
- return runkit_object_id($object);
- }
- } elseif (PHP_INT_SIZE === 8) {
- /**
- * See https://github.com/runkit7/runkit_object_id for a faster native version for php <= 7.1
- *
- * @param object $object
- * @return int (The object id, XORed with a random number)
- */
- function spl_object_id($object): int
- {
- $hash = spl_object_hash($object);
- // Fit this into a php long (32-bit or 64-bit signed int).
- // The first 16 hex digits (64 bytes) vary, the last 16 don't.
- // Values are usually padded with 0s at the front.
- return intval(substr($hash, 1, 15), 16);
- }
- } else {
- /**
- * See https://github.com/runkit7/runkit_object_id for a faster native version for php <= 7.1
- *
- * @param object $object
- * @return int (The object id, XORed with a random number)
- */
- function spl_object_id($object): int
- {
- $hash = spl_object_hash($object);
- // Fit this into a php long (32-bit or 64-bit signed int).
- // The first 16 hex digits (64 bytes) vary, the last 16 don't.
- // Values are usually padded with 0s at the front.
- return intval(substr($hash, 9, 7), 16);
- }
- }
-}
diff --git a/tests/ClosureTest.php b/tests/ClosureTest.php
index 64a17a53d28..a9291d88923 100644
--- a/tests/ClosureTest.php
+++ b/tests/ClosureTest.php
@@ -330,7 +330,7 @@ public function callTheInvokableIndirectly(): bool {
}
}',
],
- 'PHP71-mirrorCallableParams' => [
+ 'mirrorCallableParams' => [
' [
+ 'closureFromCallableInvokableNamedClass' => [
' [
+ 'closureFromCallableInvokableAnonymousClass' => [
' [
+ 'publicCallableFromInside' => [
' [
+ 'protectedCallableFromInside' => [
' [
+ 'closureFromCallableNamedFunction' => [
' 'TypeDoesNotContainType',
],
- 'PHP71-closureFromCallableInvokableNamedClassWrongArgs' => [
+ 'closureFromCallableInvokableNamedClassWrongArgs' => [
' 'DuplicateParam',
],
- 'PHP71-privateCallable' => [
+ 'privateCallable' => [
' 'int',
],
],
- 'PHP73-hrtime' => [
+ 'hrtime' => [
' 'array{0: int, 1: int}',
],
],
- 'PHP73-hrtimeCanBeFloat' => [
+ 'hrtimeCanBeFloat' => [
' [
+ 'allowIsCountableToInformType' => [
' 'array',
],
],
- 'PHP72-pregMatchWithFlagUnmatchedAsNull' => [
+ 'pregMatchWithFlagUnmatchedAsNull' => [
' [
@@ -1353,7 +1353,7 @@ function takesInt(int $i) : void {}
'$matches===' => 'array',
],
],
- 'PHP72-pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [
+ 'pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [
' [
@@ -1399,7 +1399,7 @@ function foo(int $a, string $b, bool $c) : array {
return compact("a", "b", "c");
}',
],
- 'PHP73-setCookiePhp73' => [
+ 'setCookiePhp73' => [
'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.');
}
diff --git a/tests/Traits/ValidCodeAnalysisTestTrait.php b/tests/Traits/ValidCodeAnalysisTestTrait.php
index 46a57ac4a22..0bef93d31b8 100644
--- a/tests/Traits/ValidCodeAnalysisTestTrait.php
+++ b/tests/Traits/ValidCodeAnalysisTestTrait.php
@@ -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.');
}
diff --git a/tests/TypeReconciliation/ConditionalTest.php b/tests/TypeReconciliation/ConditionalTest.php
index 670c3bb138f..a786b2ca64c 100644
--- a/tests/TypeReconciliation/ConditionalTest.php
+++ b/tests/TypeReconciliation/ConditionalTest.php
@@ -1006,7 +1006,7 @@ function f() { return rand(0,1) ? "f" : 1.1; }
atan($a);
atan($b);',
],
- 'PHP71-removeNonCallable' => [
+ 'removeNonCallable' => [
'