diff options
author | Elizabeth Danzberger <lizzy7128@tutanota.de> | 2024-07-24 19:47:14 -0400 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2024-07-25 11:11:41 +0200 |
commit | b749a89a338da6ad6d19839f18ea483ef43bb762 (patch) | |
tree | 625a0a42f76ed1ca8c21907156a693659f55df1d /lib | |
parent | bb34b0809c22bba1e83b99444e1007824221974b (diff) | |
download | nextcloud-server-b749a89a338da6ad6d19839f18ea483ef43bb762.tar.gz nextcloud-server-b749a89a338da6ad6d19839f18ea483ef43bb762.zip |
fix: PHP formatting
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/Files/Template/BeforeGetTemplatesEvent.php | 6 | ||||
-rw-r--r-- | lib/public/Files/Template/Field.php | 20 | ||||
-rw-r--r-- | lib/public/Files/Template/ITemplateManager.php | 4 |
3 files changed, 11 insertions, 19 deletions
diff --git a/lib/public/Files/Template/BeforeGetTemplatesEvent.php b/lib/public/Files/Template/BeforeGetTemplatesEvent.php index c4e23c17c7c..006163c5f7f 100644 --- a/lib/public/Files/Template/BeforeGetTemplatesEvent.php +++ b/lib/public/Files/Template/BeforeGetTemplatesEvent.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -18,7 +20,7 @@ class BeforeGetTemplatesEvent extends Event { /** * @param array<Template> $templates - * + * * @since 30.0.0 */ public function __construct(array $templates) { @@ -29,7 +31,7 @@ class BeforeGetTemplatesEvent extends Event { /** * @return array<Template> - * + * * @since 30.0.0 */ public function getTemplates(): array { diff --git a/lib/public/Files/Template/Field.php b/lib/public/Files/Template/Field.php index 49c6a033e5c..ce0ed3176d9 100644 --- a/lib/public/Files/Template/Field.php +++ b/lib/public/Files/Template/Field.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -19,32 +21,18 @@ class Field implements \JsonSerializable { private ?string $tag; /** - * @param string $index - * @param string $content - * @param FieldType $type - * @param ?string $alias - * @param ?int $id - * @param ?string $tag - * * @since 30.0.0 */ - public function __construct($index, $content, $type, $alias = null, $id = null, $tag = null) { + public function __construct(string $index, string $content, FieldType $type, ?string $alias = null, ?int $id = null, ?string $tag = null) { $this->index = $index; $this->alias = $alias; + $this->type = $type; $this->id = $id; $this->tag = $tag; $this->content = $content; - - if ($type instanceof FieldType) { - $this->type = $type; - } else { - $this->type = FieldType::tryFrom($type) ?? throw new InvalidFieldTypeException(); - } } /** - * @return array - * * @since 30.0.0 */ public function jsonSerialize(): array { diff --git a/lib/public/Files/Template/ITemplateManager.php b/lib/public/Files/Template/ITemplateManager.php index 5adcc0ded25..94e0db935e7 100644 --- a/lib/public/Files/Template/ITemplateManager.php +++ b/lib/public/Files/Template/ITemplateManager.php @@ -67,9 +67,11 @@ interface ITemplateManager { /** * @param string $filePath * @param string $templateId + * @param string $templateType + * @param array $templateFields Since 30.0.0 * @return array * @throws GenericFileException * @since 21.0.0 */ - public function createFromTemplate(string $filePath, string $templateId = '', string $templateType = 'user'): array; + public function createFromTemplate(string $filePath, string $templateId = '', string $templateType = 'user', array $templateFields = []): array; } |