diff --git a/src/TranslationAppClient.php b/src/TranslationAppClient.php index 333d99d..cad9e10 100644 --- a/src/TranslationAppClient.php +++ b/src/TranslationAppClient.php @@ -61,7 +61,7 @@ public function getTranslations(TranslationQueryValueObject $valueObject): array } } - return ['data' => $processedData, 'total' => $data?->getTotal(), 'metadata' => $metadata]; + return ['data' => $processedData, 'total' => $data?->getTotal() ?? 0, 'metadata' => $metadata]; } /** diff --git a/src/ValueObjects/TranslationItemValueObject.php b/src/ValueObjects/TranslationItemValueObject.php index eadb3a7..75c35c8 100644 --- a/src/ValueObjects/TranslationItemValueObject.php +++ b/src/ValueObjects/TranslationItemValueObject.php @@ -4,18 +4,18 @@ namespace Uc\TranslationAppSdk\ValueObjects; -readonly class TranslationItemValueObject +class TranslationItemValueObject { public function __construct( - protected string $key, - protected string $value, - protected string $languageCode, - protected string $updatedAt, - protected string $resource, - protected int $resourceId, - protected string $editor, - protected int $id, - protected ?array $params, + protected readonly string $key, + protected readonly string $value, + protected readonly string $languageCode, + protected readonly string $updatedAt, + protected readonly string $resource, + protected readonly int $resourceId, + protected readonly string $editor, + protected readonly int $id, + protected readonly ?array $params, ) { } diff --git a/src/ValueObjects/TranslationQueryValueObject.php b/src/ValueObjects/TranslationQueryValueObject.php index 8e4ce9d..bafd491 100644 --- a/src/ValueObjects/TranslationQueryValueObject.php +++ b/src/ValueObjects/TranslationQueryValueObject.php @@ -4,16 +4,16 @@ namespace Uc\TranslationAppSdk\ValueObjects; -readonly class TranslationQueryValueObject +class TranslationQueryValueObject { public function __construct( - protected int $resourceId, - protected string $languageCode, - protected string $resource, - protected ?string $key = null, - protected array $orderBy = [], - protected int $page = 0, - protected int $first = 10, + protected readonly int $resourceId, + protected readonly string $languageCode, + protected readonly string $resource, + protected readonly ?string $key = null, + protected readonly array $orderBy = [], + protected readonly int $page = 0, + protected readonly int $first = 10, ){ }