aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/TextToImage
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/TextToImage')
-rw-r--r--lib/public/TextToImage/Events/AbstractTextToImageEvent.php24
-rw-r--r--lib/public/TextToImage/Events/TaskFailedEvent.php22
-rw-r--r--lib/public/TextToImage/Events/TaskSuccessfulEvent.php22
-rw-r--r--lib/public/TextToImage/Exception/TaskFailureException.php22
-rw-r--r--lib/public/TextToImage/Exception/TaskNotFoundException.php22
-rw-r--r--lib/public/TextToImage/Exception/TextToImageException.php22
-rw-r--r--lib/public/TextToImage/IManager.php21
-rw-r--r--lib/public/TextToImage/IProvider.php21
-rw-r--r--lib/public/TextToImage/IProviderWithUserId.php6
-rw-r--r--lib/public/TextToImage/Task.php23
10 files changed, 34 insertions, 171 deletions
diff --git a/lib/public/TextToImage/Events/AbstractTextToImageEvent.php b/lib/public/TextToImage/Events/AbstractTextToImageEvent.php
index 56c68195602..df850e1be33 100644
--- a/lib/public/TextToImage/Events/AbstractTextToImageEvent.php
+++ b/lib/public/TextToImage/Events/AbstractTextToImageEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage\Events;
@@ -31,13 +14,14 @@ use OCP\TextToImage\Task;
/**
* @since 28.0.0
+ * @deprecated 30.0.0
*/
abstract class AbstractTextToImageEvent extends Event {
/**
* @since 28.0.0
*/
public function __construct(
- private Task $task
+ private Task $task,
) {
parent::__construct();
}
diff --git a/lib/public/TextToImage/Events/TaskFailedEvent.php b/lib/public/TextToImage/Events/TaskFailedEvent.php
index 0d91b3a4f67..8a1b8bbad61 100644
--- a/lib/public/TextToImage/Events/TaskFailedEvent.php
+++ b/lib/public/TextToImage/Events/TaskFailedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage\Events;
@@ -30,6 +13,7 @@ use OCP\TextToImage\Task;
/**
* @since 28.0.0
+ * @deprecated 30.0.0
*/
class TaskFailedEvent extends AbstractTextToImageEvent {
/**
diff --git a/lib/public/TextToImage/Events/TaskSuccessfulEvent.php b/lib/public/TextToImage/Events/TaskSuccessfulEvent.php
index 15d263c0ff0..ae679437457 100644
--- a/lib/public/TextToImage/Events/TaskSuccessfulEvent.php
+++ b/lib/public/TextToImage/Events/TaskSuccessfulEvent.php
@@ -3,31 +3,15 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage\Events;
/**
* @since 28.0.0
+ * @deprecated 30.0.0
*/
class TaskSuccessfulEvent extends AbstractTextToImageEvent {
}
diff --git a/lib/public/TextToImage/Exception/TaskFailureException.php b/lib/public/TextToImage/Exception/TaskFailureException.php
index a640fdff2e8..89144c3033a 100644
--- a/lib/public/TextToImage/Exception/TaskFailureException.php
+++ b/lib/public/TextToImage/Exception/TaskFailureException.php
@@ -1,31 +1,15 @@
<?php
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage\Exception;
/**
* @since 28.0.0
+ * @deprecated 30.0.0
*/
class TaskFailureException extends TextToImageException {
}
diff --git a/lib/public/TextToImage/Exception/TaskNotFoundException.php b/lib/public/TextToImage/Exception/TaskNotFoundException.php
index bd713fe3905..a488eceb7f4 100644
--- a/lib/public/TextToImage/Exception/TaskNotFoundException.php
+++ b/lib/public/TextToImage/Exception/TaskNotFoundException.php
@@ -1,31 +1,15 @@
<?php
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage\Exception;
/**
* @since 28.0.0
+ * @deprecated 30.0.0
*/
class TaskNotFoundException extends TextToImageException {
}
diff --git a/lib/public/TextToImage/Exception/TextToImageException.php b/lib/public/TextToImage/Exception/TextToImageException.php
index 3d4fd192c94..d8672544072 100644
--- a/lib/public/TextToImage/Exception/TextToImageException.php
+++ b/lib/public/TextToImage/Exception/TextToImageException.php
@@ -1,31 +1,15 @@
<?php
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage\Exception;
/**
* @since 28.0.0
+ * @deprecated 30.0.0
*/
class TextToImageException extends \Exception {
}
diff --git a/lib/public/TextToImage/IManager.php b/lib/public/TextToImage/IManager.php
index f2092476e78..df8adfc39f4 100644
--- a/lib/public/TextToImage/IManager.php
+++ b/lib/public/TextToImage/IManager.php
@@ -3,24 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
@@ -36,6 +20,7 @@ use RuntimeException;
* API surface for apps interacting with and making use of TextToImage providers
* without knowing which providers are installed
* @since 28.0.0
+ * @deprecated 30.0.0
*/
interface IManager {
/**
diff --git a/lib/public/TextToImage/IProvider.php b/lib/public/TextToImage/IProvider.php
index 9f2ff51f599..4a278a0d706 100644
--- a/lib/public/TextToImage/IProvider.php
+++ b/lib/public/TextToImage/IProvider.php
@@ -3,24 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage;
@@ -31,6 +15,7 @@ use RuntimeException;
* This is the interface that is implemented by apps that
* implement a text to image provider
* @since 28.0.0
+ * @deprecated 30.0.0
*/
interface IProvider {
/**
diff --git a/lib/public/TextToImage/IProviderWithUserId.php b/lib/public/TextToImage/IProviderWithUserId.php
index 8afb0e56fbb..a3eedbd9dc0 100644
--- a/lib/public/TextToImage/IProviderWithUserId.php
+++ b/lib/public/TextToImage/IProviderWithUserId.php
@@ -1,11 +1,15 @@
<?php
declare(strict_types=1);
-
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
namespace OCP\TextToImage;
/**
* @since 29.0.0
+ * @deprecated 30.0.0
*/
interface IProviderWithUserId extends IProvider {
/**
diff --git a/lib/public/TextToImage/Task.php b/lib/public/TextToImage/Task.php
index e610af6aa96..7b94de0fbb3 100644
--- a/lib/public/TextToImage/Task.php
+++ b/lib/public/TextToImage/Task.php
@@ -3,24 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\TextToImage;
@@ -36,6 +20,7 @@ use OCP\Image;
* This is a text to image task
*
* @since 28.0.0
+ * @deprecated 30.0.0
*/
final class Task implements \JsonSerializable {
protected ?int $id = null;
@@ -96,7 +81,7 @@ final class Task implements \JsonSerializable {
$images = [];
for ($i = 0; $i < $this->getNumberOfImages(); $i++) {
$image = new Image();
- $image->loadFromFileHandle($folder->getFile((string) $i)->read());
+ $image->loadFromFileHandle($folder->getFile((string)$i)->read());
$images[] = $image;
}
return $images;