From 20567ff72067c50686d97def7365542af202802f Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Tue, 4 Jan 2022 11:29:00 +0200 Subject: [PATCH] Remove the polyfill we no longer need --- composer.json | 5 +--- psalm.xml.dist | 1 - src/spl_object_id.php | 54 ------------------------------------------- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 src/spl_object_id.php diff --git a/composer.json b/composer.json index db1cd2a84..93fd17b9f 100644 --- a/composer.json +++ b/composer.json @@ -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 0343b7cb1..c1ddfa58b 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 8b30da94a..000000000 --- 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); - } - } -}