]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: Fix static analysis errors
authorElizabeth Danzberger <lizzy7128@tutanota.de>
Wed, 24 Jul 2024 23:41:52 +0000 (19:41 -0400)
committerJulius Härtl <jus@bitgrid.net>
Thu, 25 Jul 2024 09:11:41 +0000 (11:11 +0200)
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
lib/public/Files/Template/BeforeGetTemplatesEvent.php
lib/public/Files/Template/Field.php
lib/public/Files/Template/FieldType.php

index dee4154b98ddea8e3af1080bd361a85726bf32b7..c4e23c17c7ce6f807d327e0ee2e20e8849a9da27 100644 (file)
@@ -9,15 +9,29 @@ namespace OCP\Files\Template;
 
 use OCP\EventDispatcher\Event;
 
+/**
+ * @since 30.0.0
+ */
 class BeforeGetTemplatesEvent extends Event {
+       /** @var array<Template> */
        private array $templates;
 
+       /**
+        * @param array<Template> $templates
+        * 
+        * @since 30.0.0
+        */
        public function __construct(array $templates) {
                parent::__construct();
 
                $this->templates = $templates;
        }
 
+       /**
+        * @return array<Template>
+        * 
+        * @since 30.0.0
+        */
        public function getTemplates(): array {
                return $this->templates;
        }
index ea200b74a00b1059bfa0d0f8816bd299920ae4b1..49c6a033e5ce4483ca5c4e3682a67ef1be646269 100644 (file)
@@ -7,6 +7,9 @@
 
 namespace OCP\Files\Template;
 
+/**
+ * @since 30.0.0
+ */
 class Field implements \JsonSerializable {
        private string $index;
        private string $content;
@@ -15,6 +18,16 @@ class Field implements \JsonSerializable {
        private ?int $id;
        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) {
                $this->index = $index;
                $this->alias = $alias;
@@ -29,6 +42,11 @@ class Field implements \JsonSerializable {
                }
        }
 
+       /**
+        * @return array
+        * 
+        * @since 30.0.0
+        */
        public function jsonSerialize(): array {
                return [
                        "index" => $this->index,
index 12ca7039da3cf37e4e3314fdd413e7ad1614c26b..ff3080406a74f625de35f4607a925ff42620bc05 100644 (file)
@@ -7,6 +7,9 @@
 
 namespace OCP\Files\Template;
 
+/**
+ * @since 30.0.0
+ */
 enum FieldType: string {
        case RichText = "rich-text";
        case CheckBox = "checkbox";