29 lines
583 B
PHP
29 lines
583 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Dto\Service\ProjectTranslationServiceTextHash;
|
|
|
|
final class Hashes
|
|
{
|
|
private array $hashes = [];
|
|
private array $ids = [];
|
|
|
|
public function add(int $hashId, string $code, string $hash): void
|
|
{
|
|
$this->hashes[$hashId] = [
|
|
'code' => $code,
|
|
'hash' => $hash,
|
|
];
|
|
$this->ids[] = $hashId;
|
|
}
|
|
|
|
public function getHash(int $hashId): ?array
|
|
{
|
|
return $this->hashes[$hashId] ?? null;
|
|
}
|
|
|
|
public function getIds(): array
|
|
{
|
|
return $this->ids;
|
|
}
|
|
}
|