refactor: mail interfaces
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -18,16 +18,17 @@ namespace KTXF\Resource\Provider\Node;
|
||||
*/
|
||||
abstract class NodePropertiesBaseAbstract implements NodePropertiesBaseInterface {
|
||||
|
||||
protected string $type = 'resource.data';
|
||||
protected array $data = [];
|
||||
|
||||
public function __construct(array $data) {
|
||||
|
||||
if (!isset($data[static::JSON_PROPERTY_TYPE])) {
|
||||
$data[static::JSON_PROPERTY_TYPE] = static::JSON_TYPE;
|
||||
if (!isset($data[static::PROPERTY_TYPE])) {
|
||||
$data[static::PROPERTY_TYPE] = $this->type;
|
||||
}
|
||||
|
||||
if (!isset($data[static::JSON_PROPERTY_SCHEMA])) {
|
||||
$data[static::JSON_PROPERTY_SCHEMA] = 1;
|
||||
if (!isset($data[static::PROPERTY_SCHEMA])) {
|
||||
$data[static::PROPERTY_SCHEMA] = 1;
|
||||
}
|
||||
|
||||
$this->data = $data;
|
||||
@@ -44,14 +45,14 @@ abstract class NodePropertiesBaseAbstract implements NodePropertiesBaseInterface
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function type(): string {
|
||||
return $this->data[static::JSON_PROPERTY_TYPE];
|
||||
return $this->data[static::PROPERTY_TYPE];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function schema(): int {
|
||||
return $this->data[static::JSON_PROPERTY_SCHEMA];
|
||||
return $this->data[static::PROPERTY_SCHEMA];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user