mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix: Fix static analysis errors
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
This commit is contained in:
parent
6aea44920d
commit
bb34b0809c
3 changed files with 35 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
namespace OCP\Files\Template;
|
||||
|
||||
/**
|
||||
* @since 30.0.0
|
||||
*/
|
||||
enum FieldType: string {
|
||||
case RichText = "rich-text";
|
||||
case CheckBox = "checkbox";
|
||||
|
|
|
|||
Loading…
Reference in a new issue