aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Command
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Command')
-rw-r--r--lib/private/Command/AsyncBus.php22
-rw-r--r--lib/private/Command/CallableJob.php24
-rw-r--r--lib/private/Command/ClosureJob.php25
-rw-r--r--lib/private/Command/CommandJob.php25
-rw-r--r--lib/private/Command/CronBus.php53
-rw-r--r--lib/private/Command/FileAccess.php23
-rw-r--r--lib/private/Command/QueueBus.php24
7 files changed, 41 insertions, 155 deletions
diff --git a/lib/private/Command/AsyncBus.php b/lib/private/Command/AsyncBus.php
index c65e6cad78e..fb7860c9dd8 100644
--- a/lib/private/Command/AsyncBus.php
+++ b/lib/private/Command/AsyncBus.php
@@ -1,23 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Command;
diff --git a/lib/private/Command/CallableJob.php b/lib/private/Command/CallableJob.php
index 8bb3c76c9af..8744977a81e 100644
--- a/lib/private/Command/CallableJob.php
+++ b/lib/private/Command/CallableJob.php
@@ -1,27 +1,13 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Command;
-use OC\BackgroundJob\QueuedJob;
+use OCP\BackgroundJob\QueuedJob;
class CallableJob extends QueuedJob {
protected function run($serializedCallable) {
diff --git a/lib/private/Command/ClosureJob.php b/lib/private/Command/ClosureJob.php
index f7b0ee1a3d3..58fe9696437 100644
--- a/lib/private/Command/ClosureJob.php
+++ b/lib/private/Command/ClosureJob.php
@@ -1,29 +1,14 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Command;
use Laravel\SerializableClosure\SerializableClosure as LaravelClosure;
-use OC\BackgroundJob\QueuedJob;
+use OCP\BackgroundJob\QueuedJob;
class ClosureJob extends QueuedJob {
protected function run($argument) {
diff --git a/lib/private/Command/CommandJob.php b/lib/private/Command/CommandJob.php
index e34ffe9440b..41ca3a9cb40 100644
--- a/lib/private/Command/CommandJob.php
+++ b/lib/private/Command/CommandJob.php
@@ -1,28 +1,13 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Command;
-use OC\BackgroundJob\QueuedJob;
+use OCP\BackgroundJob\QueuedJob;
use OCP\Command\ICommand;
/**
diff --git a/lib/private/Command/CronBus.php b/lib/private/Command/CronBus.php
index 42ff458a95c..a12520469a9 100644
--- a/lib/private/Command/CronBus.php
+++ b/lib/private/Command/CronBus.php
@@ -1,56 +1,31 @@
<?php
+
/**
- * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Command;
use Laravel\SerializableClosure\SerializableClosure;
+use OCP\BackgroundJob\IJob;
+use OCP\BackgroundJob\IJobList;
use OCP\Command\ICommand;
class CronBus extends AsyncBus {
- /**
- * @var \OCP\BackgroundJob\IJobList
- */
- private $jobList;
-
-
- /**
- * @param \OCP\BackgroundJob\IJobList $jobList
- */
- public function __construct($jobList) {
- $this->jobList = $jobList;
+ public function __construct(
+ private IJobList $jobList,
+ ) {
}
- protected function queueCommand($command) {
+ protected function queueCommand($command): void {
$this->jobList->add($this->getJobClass($command), $this->serializeCommand($command));
}
/**
- * @param \OCP\Command\ICommand | callable $command
- * @return string
+ * @param ICommand|callable $command
+ * @return class-string<IJob>
*/
- private function getJobClass($command) {
+ private function getJobClass($command): string {
if ($command instanceof \Closure) {
return ClosureJob::class;
} elseif (is_callable($command)) {
@@ -63,10 +38,10 @@ class CronBus extends AsyncBus {
}
/**
- * @param \OCP\Command\ICommand | callable $command
+ * @param ICommand|callable $command
* @return string
*/
- private function serializeCommand($command) {
+ private function serializeCommand($command): string {
if ($command instanceof \Closure) {
return serialize(new SerializableClosure($command));
} elseif (is_callable($command) or $command instanceof ICommand) {
diff --git a/lib/private/Command/FileAccess.php b/lib/private/Command/FileAccess.php
index 584e61696c3..1af1591492d 100644
--- a/lib/private/Command/FileAccess.php
+++ b/lib/private/Command/FileAccess.php
@@ -1,24 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Command;
diff --git a/lib/private/Command/QueueBus.php b/lib/private/Command/QueueBus.php
index b2ceea744bc..ed7d43b38b6 100644
--- a/lib/private/Command/QueueBus.php
+++ b/lib/private/Command/QueueBus.php
@@ -1,25 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Julius Härtl <jus@bitgrid.net>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Command;