lots of improvements

This commit is contained in:
root
2026-02-10 17:47:48 -05:00
parent 6d0c5584bd
commit b87b5d9052
65 changed files with 3445 additions and 1577 deletions

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Resource\Delta;
use KTXF\Json\JsonSerializable;
class Delta implements JsonSerializable {
public function __construct(
public ?DeltaCollection $additions = null,
public ?DeltaCollection $modifications = null,
public ?DeltaCollection $deletions = null,
public ?string $signature = null,
) {
if ($this->additions === null) {
$this->additions = new DeltaCollection;
}
if ($this->modifications === null) {
$this->modifications = new DeltaCollection;
}
if ($this->deletions === null) {
$this->deletions = new DeltaCollection;
}
if ($this->signature === null) {
$this->signature = '';
}
}
public function jsonSerialize(): array {
return [
'signature' => $this->signature,
'additions' => $this->additions,
'modifications' => $this->modifications,
'deletions' => $this->deletions,
];
}
}