diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-11-28 14:58:47 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-12-02 20:16:57 +0100 |
commit | 04c037ebfd80e6f91edafa24b2cd06ecceb1fc43 (patch) | |
tree | 009f85b5570536eef70909492ef0ecdf5cbc3b11 /lib/private/Command | |
parent | 6f4d3edb5e5bcb343012b378e22500e614c2cc38 (diff) | |
download | nextcloud-server-04c037ebfd80e6f91edafa24b2cd06ecceb1fc43.tar.gz nextcloud-server-04c037ebfd80e6f91edafa24b2cd06ecceb1fc43.zip |
[3rdparty] Migrate to Opis/Closure
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Command')
-rw-r--r-- | lib/private/Command/ClosureJob.php | 4 | ||||
-rw-r--r-- | lib/private/Command/CommandJob.php | 2 | ||||
-rw-r--r-- | lib/private/Command/CronBus.php | 6 |
3 files changed, 4 insertions, 8 deletions
diff --git a/lib/private/Command/ClosureJob.php b/lib/private/Command/ClosureJob.php index d67dad348a3..1f8470005e4 100644 --- a/lib/private/Command/ClosureJob.php +++ b/lib/private/Command/ClosureJob.php @@ -23,12 +23,10 @@ namespace OC\Command; use OC\BackgroundJob\QueuedJob; -use SuperClosure\Serializer; class ClosureJob extends QueuedJob { protected function run($serializedCallable) { - $serializer = new Serializer(); - $callable = $serializer->unserialize($serializedCallable); + $callable = \Opis\Closure\unserialize($serializedCallable); if (is_callable($callable)) { $callable(); } else { diff --git a/lib/private/Command/CommandJob.php b/lib/private/Command/CommandJob.php index 7b2ae60beab..6b1e79f93de 100644 --- a/lib/private/Command/CommandJob.php +++ b/lib/private/Command/CommandJob.php @@ -30,7 +30,7 @@ use OCP\Command\ICommand; */ class CommandJob extends QueuedJob { protected function run($serializedCommand) { - $command = unserialize($serializedCommand); + $command = \Opis\Closure\unserialize($serializedCommand); if ($command instanceof ICommand) { $command->handle(); } else { diff --git a/lib/private/Command/CronBus.php b/lib/private/Command/CronBus.php index 5bb8e4b0045..32f19c913e8 100644 --- a/lib/private/Command/CronBus.php +++ b/lib/private/Command/CronBus.php @@ -26,7 +26,6 @@ namespace OC\Command; use OCP\Command\ICommand; -use SuperClosure\Serializer; class CronBus extends AsyncBus { /** @@ -68,10 +67,9 @@ class CronBus extends AsyncBus { */ private function serializeCommand($command) { if ($command instanceof \Closure) { - $serializer = new Serializer(); - return $serializer->serialize($command); + return \Opis\Closure\serialize($command); } elseif (is_callable($command) or $command instanceof ICommand) { - return serialize($command); + return \Opis\Closure\serialize($command); } else { throw new \InvalidArgumentException('Invalid command'); } |