diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-12-03 08:44:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 08:44:53 +0100 |
commit | fbc06d39c767f5301665a67638c49060e84a5a9d (patch) | |
tree | 6160c1597d324012f07f917696320f3791526026 | |
parent | b52a1e196ef6bdc6b099bb48e3eaae99ad51b5af (diff) | |
parent | 40ebe24960958ec4212a0df0a963d032cc788326 (diff) | |
download | nextcloud-server-fbc06d39c767f5301665a67638c49060e84a5a9d.tar.gz nextcloud-server-fbc06d39c767f5301665a67638c49060e84a5a9d.zip |
Merge pull request #24429 from nextcloud/3rdparty/closure
[3rdparty] Migrate to Opis/Closure
m--------- | 3rdparty | 0 | ||||
-rw-r--r-- | build/psalm-baseline.xml | 15 | ||||
-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 |
5 files changed, 19 insertions, 8 deletions
diff --git a/3rdparty b/3rdparty -Subproject 8d7a96cde06a0357ce5805e00773b576d7595ef +Subproject 8f03ccac97331ff781340d76a3f4a49a017d6ae diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index e07218cf078..379ea1a1c97 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -3281,6 +3281,21 @@ <code>''</code> </TypeDoesNotContainType> </file> + <file src="lib/private/Command/ClosureJob.php"> + <UndefinedFunction occurrences="1"> + <code>\Opis\Closure\unserialize($serializedCallable)</code> + </UndefinedFunction> + </file> + <file src="lib/private/Command/CommandJob.php"> + <UndefinedFunction occurrences="1"> + <code>\Opis\Closure\unserialize($serializedCommand)</code> + </UndefinedFunction> + </file> + <file src="lib/private/Command/CronBus.php"> + <UndefinedFunction occurrences="1"> + <code>\Opis\Closure\serialize($command)</code> + </UndefinedFunction> + </file> <file src="lib/private/Comments/Comment.php"> <ImplementedReturnTypeMismatch occurrences="1"> <code>\DateTime|null</code> 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'); } |