<?php

namespace Signteer\Core\Event\Signup;

use Signteer\Core\Event\StorableEventInterface;

final class SignupCreated implements StorableEventInterface
{
    private int $id;

    public function __construct(int $id)
    {
        $this->id = $id;
    }

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

    public static function alias(): string
    {
        return 'signup-created';
    }

    public function toArray(): array
    {
        return ['id' => $this->id];
    }

    public static function fromArray(array $a)
    {
        return new self($a['id']);
    }
}
