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;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,23 +16,23 @@ abstract class EntityPropertiesBaseAbstract extends NodePropertiesBaseAbstract i
|
||||
public const JSON_TYPE = EntityPropertiesBaseInterface::JSON_TYPE;
|
||||
|
||||
public function size(): int {
|
||||
return $this->data[self::JSON_PROPERTY_SIZE] ?? 0;
|
||||
return $this->data[self::PROPERTY_SIZE] ?? 0;
|
||||
}
|
||||
|
||||
public function getLabel(): string {
|
||||
return $this->data[self::JSON_PROPERTY_LABEL] ?? '';
|
||||
return $this->data[self::PROPERTY_LABEL] ?? '';
|
||||
}
|
||||
|
||||
public function getMime(): string {
|
||||
return $this->data[self::JSON_PROPERTY_MIME] ?? '';
|
||||
return $this->data[self::PROPERTY_MIME] ?? '';
|
||||
}
|
||||
|
||||
public function getFormat(): string {
|
||||
return $this->data[self::JSON_PROPERTY_FORMAT] ?? '';
|
||||
return $this->data[self::PROPERTY_FORMAT] ?? '';
|
||||
}
|
||||
|
||||
public function getEncoding(): string {
|
||||
return $this->data[self::JSON_PROPERTY_ENCODING] ?? '';
|
||||
return $this->data[self::PROPERTY_ENCODING] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ use KTXF\Resource\Provider\Node\NodePropertiesBaseInterface;
|
||||
interface EntityPropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
|
||||
public const JSON_TYPE = 'document:file';
|
||||
public const JSON_PROPERTY_LABEL = 'label';
|
||||
public const JSON_PROPERTY_SIZE = 'size';
|
||||
public const JSON_PROPERTY_MIME = 'mime';
|
||||
public const JSON_PROPERTY_FORMAT = 'format';
|
||||
public const JSON_PROPERTY_ENCODING = 'encoding';
|
||||
public const PROPERTY_LABEL = 'label';
|
||||
public const PROPERTY_SIZE = 'size';
|
||||
public const PROPERTY_MIME = 'mime';
|
||||
public const PROPERTY_FORMAT = 'format';
|
||||
public const PROPERTY_ENCODING = 'encoding';
|
||||
|
||||
public function size(): int;
|
||||
|
||||
|
||||
@@ -24,22 +24,22 @@ abstract class EntityPropertiesMutableAbstract extends EntityPropertiesBaseAbstr
|
||||
}
|
||||
|
||||
public function setLabel(string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_LABEL] = $value;
|
||||
$this->data[self::PROPERTY_LABEL] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMime(string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_MIME] = $value;
|
||||
$this->data[self::PROPERTY_MIME] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFormat(string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_FORMAT] = $value;
|
||||
$this->data[self::PROPERTY_FORMAT] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setEncoding(string $value): static {
|
||||
$this->data[self::JSON_PROPERTY_ENCODING] = $value;
|
||||
$this->data[self::PROPERTY_ENCODING] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user