From 97a024f03598d6d6bfc26a860f4a3d5e2803b779 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Tue, 19 Sep 2023 15:19:04 +0200 Subject: [PATCH] chore(3rdparty): remove opis/closure - We are using laravel/serializable-closure for a while now. - The package was there for compatibility reasons but does not play nice with PHP 8.1. Signed-off-by: Daniel Kesselberg --- 3rdparty | 2 +- lib/private/Command/ClosureJob.php | 3 +-- tests/lib/Command/CronBusTest.php | 7 ------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/3rdparty b/3rdparty index ed6ea207de9..a983a316487 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit ed6ea207de9e7649d5f7321497a27f5612d6e100 +Subproject commit a983a316487c666d6602923f0c067e32299501ba diff --git a/lib/private/Command/ClosureJob.php b/lib/private/Command/ClosureJob.php index 5639852e4db..180c5a33ec5 100644 --- a/lib/private/Command/ClosureJob.php +++ b/lib/private/Command/ClosureJob.php @@ -24,11 +24,10 @@ namespace OC\Command; use OC\BackgroundJob\QueuedJob; use Laravel\SerializableClosure\SerializableClosure as LaravelClosure; -use Opis\Closure\SerializableClosure as OpisClosure; class ClosureJob extends QueuedJob { protected function run($serializedCallable) { - $callable = unserialize($serializedCallable, [LaravelClosure::class, OpisClosure::class]); + $callable = unserialize($serializedCallable, [LaravelClosure::class]); $callable = $callable->getClosure(); if (is_callable($callable)) { $callable(); diff --git a/tests/lib/Command/CronBusTest.php b/tests/lib/Command/CronBusTest.php index 100de0a861c..ea610a135d8 100644 --- a/tests/lib/Command/CronBusTest.php +++ b/tests/lib/Command/CronBusTest.php @@ -47,11 +47,4 @@ class CronBusTest extends AsyncBusTest { $job->execute($this->jobList); } } - - public function testClosureFromPreviousVersion() { - $serializedClosure = 'C:32:"Opis\\Closure\\SerializableClosure":217:{a:5:{s:3:"use";a:0:{}s:8:"function";s:64:"function () {\\Test\\Command\\AsyncBusTest::$lastCommand = \'opis\';}";s:5:"scope";s:24:"Test\\Command\\CronBusTest";s:4:"this";N;s:4:"self";s:32:"0000000027dcfe2f00000000407fa805";}}'; - $this->jobList->add('OC\Command\ClosureJob', $serializedClosure); - $this->runJobs(); - $this->assertEquals('opis', AsyncBusTest::$lastCommand); - } }