refactor: use new documents interfaces

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-07-09 19:39:29 -04:00
parent a3566405d0
commit 24d5410a09
7 changed files with 337 additions and 333 deletions
+10 -10
View File
@@ -9,7 +9,7 @@ declare(strict_types=1);
namespace KTXM\ProviderLocalDocuments\Providers\Personal;
use KTXF\Resource\Documents\Entity\EntityPropertiesMutableAbstract;
use KTXF\Documents\Entity\EntityPropertiesMutableAbstract;
class EntityProperties extends EntityPropertiesMutableAbstract {
@@ -23,23 +23,23 @@ class EntityProperties extends EntityPropertiesMutableAbstract {
}
if (isset($data['size'])) {
$this->data[self::JSON_PROPERTY_SIZE] = (int) $data['size'];
$this->data[self::PROPERTY_SIZE] = (int) $data['size'];
}
if (isset($data['label'])) {
$this->data[self::JSON_PROPERTY_LABEL] = (string) $data['label'];
$this->data[self::PROPERTY_LABEL] = (string) $data['label'];
}
if (isset($data['mime'])) {
$this->data[self::JSON_PROPERTY_MIME] = (string) $data['mime'];
$this->data[self::PROPERTY_MIME] = (string) $data['mime'];
}
if (isset($data['format'])) {
$this->data[self::JSON_PROPERTY_FORMAT] = (string) $data['format'];
$this->data[self::PROPERTY_FORMAT] = (string) $data['format'];
}
if (isset($data['encoding'])) {
$this->data[self::JSON_PROPERTY_ENCODING] = (string) $data['encoding'];
$this->data[self::PROPERTY_ENCODING] = (string) $data['encoding'];
}
return $this;
@@ -50,10 +50,10 @@ class EntityProperties extends EntityPropertiesMutableAbstract {
*/
public function toStore(): array {
return array_filter([
'label' => $this->data[self::JSON_PROPERTY_LABEL],
'mime' => $this->data[self::JSON_PROPERTY_MIME] ?? 'application/octet-stream',
'format' => $this->data[self::JSON_PROPERTY_FORMAT] ?? null,
'encoding' => $this->data[self::JSON_PROPERTY_ENCODING] ?? null,
'label' => $this->data[self::PROPERTY_LABEL],
'mime' => $this->data[self::PROPERTY_MIME] ?? 'application/octet-stream',
'format' => $this->data[self::PROPERTY_FORMAT] ?? null,
'encoding' => $this->data[self::PROPERTY_ENCODING] ?? null,
], static fn($value) => $value !== null);
}
}