<?php

declare(strict_types=1);

namespace PhpWA\Storage;

use InvalidArgumentException;
use PhpWA\Auth\AuthenticationCredentials;

final class CredentialRecord
{
      private $credentials;
      private $revision;

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

    public function credentials(): AuthenticationCredentials
    {
        return $this->credentials;
    }

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