<?php

declare(strict_types=1);

namespace PhpWA\Storage;

use InvalidArgumentException;

final class StoredValue
{
      private $value;
      private $revision;

    public function __construct(string $value, int $revision)
    {
        if ($revision < 1) {
            throw new InvalidArgumentException('Stored value revision must be positive.');
        }
        $this->value = $value;
        $this->revision = $revision;
    }

    public function value(): string { return $this->value; }
    public function revision(): int { return $this->revision; }
}
