fix: Fix static analysis errors

Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
This commit is contained in:
Elizabeth Danzberger 2024-07-24 19:41:52 -04:00 committed by Julius Härtl
parent 6aea44920d
commit bb34b0809c
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
3 changed files with 35 additions and 0 deletions

View 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;
}

View 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,

View file

@ -7,6 +7,9 @@
namespace OCP\Files\Template;
/**
* @since 30.0.0
*/
enum FieldType: string {
case RichText = "rich-text";
case CheckBox = "checkbox";