From 64d0187b52e5c6b5c96295a9742539d99129700d Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 27 Jan 2025 12:57:59 +0000 Subject: [PATCH] Remove APC bits These have been deprecated for a looooooong time, and are no longer even present in 8.1+, which breaks generation with multiple versions --- composer.json | 1 - deprecated/Exceptions/ApcException.php | 11 - deprecated/apc.php | 238 --------------------- deprecated/functionsList.php | 10 - generated/functionsList.php | 1 - generator/config/specialCasesFunctions.php | 1 - generator/tests/DeprecateCommandTest.php | 6 +- lib/special_cases.php | 22 -- rector-migrate.php | 1 - 9 files changed, 2 insertions(+), 289 deletions(-) delete mode 100644 deprecated/Exceptions/ApcException.php delete mode 100644 deprecated/apc.php diff --git a/composer.json b/composer.json index 18a794bf..27ac5329 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "generated/Exceptions/" ], "files": [ - "deprecated/apc.php", "deprecated/array.php", "deprecated/datetime.php", "deprecated/libevent.php", diff --git a/deprecated/Exceptions/ApcException.php b/deprecated/Exceptions/ApcException.php deleted file mode 100644 index 3a9d3c56..00000000 --- a/deprecated/Exceptions/ApcException.php +++ /dev/null @@ -1,11 +0,0 @@ -assertEquals('Exceptions/ApcException.php', DeprecateCommand::getExceptionFilePath('apc')); + $this->assertEquals('Exceptions/PasswordException.php', DeprecateCommand::getExceptionFilePath('password')); } - -} \ No newline at end of file +} diff --git a/lib/special_cases.php b/lib/special_cases.php index 2b368fce..f3371119 100644 --- a/lib/special_cases.php +++ b/lib/special_cases.php @@ -11,7 +11,6 @@ use Safe\Exceptions\MiscException; use Safe\Exceptions\PosixException; use Safe\Exceptions\SocketsException; -use Safe\Exceptions\ApcException; use Safe\Exceptions\ApcuException; use Safe\Exceptions\JsonException; use Safe\Exceptions\OpensslException; @@ -43,27 +42,6 @@ function json_decode(string $json, bool $associative = false, int $depth = 512, return $data; } - -/** - * Fetchs a stored variable from the cache. - * - * @param mixed $key The key used to store the value (with - * apc_store). If an array is passed then each - * element is fetched and returned. - * @return mixed The stored variable or array of variables on success; FALSE on failure - * @throws ApcException - * - */ -function apc_fetch($key) -{ - error_clear_last(); - $result = \apc_fetch($key, $success); - if ($success === false) { - throw ApcException::createFromPhpError(); - } - return $result; -} - /** * Fetchs an entry from the cache. * diff --git a/rector-migrate.php b/rector-migrate.php index 40af01b2..d84fbaed 100644 --- a/rector-migrate.php +++ b/rector-migrate.php @@ -18,7 +18,6 @@ 'apcu_fetch' => 'Safe\apcu_fetch', 'apcu_inc' => 'Safe\apcu_inc', 'apcu_sma_info' => 'Safe\apcu_sma_info', - 'apc_fetch' => 'Safe\apc_fetch', 'array_all' => 'Safe\array_all', 'base64_decode' => 'Safe\base64_decode', 'bindtextdomain' => 'Safe\bindtextdomain',