refactor: object property names
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ abstract class CollectionPropertiesBaseAbstract extends NodePropertiesBaseAbstra
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function content(): CollectionContent {
|
||||
$content = $this->data[self::JSON_PROPERTY_CONTENTS] ?? null;
|
||||
$content = $this->data[self::PROPERTY_CONTENTS] ?? null;
|
||||
if ($content instanceof CollectionContent) {
|
||||
return $content;
|
||||
}
|
||||
@@ -42,35 +42,35 @@ abstract class CollectionPropertiesBaseAbstract extends NodePropertiesBaseAbstra
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLabel(): string {
|
||||
return $this->data[self::JSON_PROPERTY_LABEL] ?? '';
|
||||
return $this->data[self::PROPERTY_LABEL] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getDescription(): ?string {
|
||||
return $this->data[self::JSON_PROPERTY_DESCRIPTION] ?? null;
|
||||
return $this->data[self::PROPERTY_DESCRIPTION] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPriority(): ?int {
|
||||
return $this->data[self::JSON_PROPERTY_PRIORITY] ?? null;
|
||||
return $this->data[self::PROPERTY_PRIORITY] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getVisibility(): ?bool {
|
||||
return $this->data[self::JSON_PROPERTY_VISIBILITY] ?? null;
|
||||
return $this->data[self::PROPERTY_VISIBILITY] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getColor(): ?string {
|
||||
return $this->data[self::JSON_PROPERTY_COLOR] ?? null;
|
||||
return $this->data[self::PROPERTY_COLOR] ?? null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ use KTXF\Resource\Provider\Node\NodePropertiesBaseInterface;
|
||||
interface CollectionPropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
|
||||
public const JSON_TYPE = 'chrono:collection';
|
||||
public const JSON_PROPERTY_CONTENTS = 'content';
|
||||
public const PROPERTY_CONTENTS = 'content';
|
||||
|
||||
public const JSON_PROPERTY_LABEL = 'label';
|
||||
public const JSON_PROPERTY_DESCRIPTION = 'description';
|
||||
public const JSON_PROPERTY_PRIORITY = 'priority';
|
||||
public const JSON_PROPERTY_VISIBILITY = 'visibility';
|
||||
public const JSON_PROPERTY_COLOR = 'color';
|
||||
public const PROPERTY_LABEL = 'label';
|
||||
public const PROPERTY_DESCRIPTION = 'description';
|
||||
public const PROPERTY_PRIORITY = 'priority';
|
||||
public const PROPERTY_VISIBILITY = 'visibility';
|
||||
public const PROPERTY_COLOR = 'color';
|
||||
|
||||
public function content(): CollectionContent;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ abstract class CollectionPropertiesMutableAbstract extends CollectionPropertiesB
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setLabel(string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_LABEL] = $value;
|
||||
$this->data[self::PROPERTY_LABEL] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ abstract class CollectionPropertiesMutableAbstract extends CollectionPropertiesB
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setDescription(?string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_DESCRIPTION] = $value;
|
||||
$this->data[self::PROPERTY_DESCRIPTION] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ abstract class CollectionPropertiesMutableAbstract extends CollectionPropertiesB
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setPriority(?int $value): static {
|
||||
$this->data[self::JSON_PROPERTY_PRIORITY] = $value;
|
||||
$this->data[self::PROPERTY_PRIORITY] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ abstract class CollectionPropertiesMutableAbstract extends CollectionPropertiesB
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setVisibility(?bool $value): static {
|
||||
$this->data[self::JSON_PROPERTY_VISIBILITY] = $value;
|
||||
$this->data[self::PROPERTY_VISIBILITY] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class CollectionPropertiesMutableAbstract extends CollectionPropertiesB
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function setColor(?string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_COLOR] = $value;
|
||||
$this->data[self::PROPERTY_COLOR] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user