refactor: object property names
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ abstract class CollectionPropertiesBaseAbstract extends NodePropertiesBaseAbstra
|
||||
public const JSON_TYPE = CollectionPropertiesBaseInterface::JSON_TYPE;
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ abstract class CollectionPropertiesBaseAbstract extends NodePropertiesBaseAbstra
|
||||
}
|
||||
|
||||
public function getLabel(): string {
|
||||
return $this->data[self::JSON_PROPERTY_LABEL] ?? '';
|
||||
return $this->data[self::PROPERTY_LABEL] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ use KTXF\Resource\Provider\Node\NodePropertiesBaseInterface;
|
||||
interface CollectionPropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
|
||||
public const JSON_TYPE = 'document:collection';
|
||||
public const JSON_PROPERTY_CONTENTS = 'content';
|
||||
public const JSON_PROPERTY_LABEL = 'label';
|
||||
public const PROPERTY_CONTENTS = 'content';
|
||||
public const PROPERTY_LABEL = 'label';
|
||||
|
||||
public function content(): CollectionContent;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ abstract class CollectionPropertiesMutableAbstract extends CollectionPropertiesB
|
||||
}
|
||||
|
||||
public function setLabel(string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_LABEL] = $value;
|
||||
$this->data[self::PROPERTY_LABEL] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user