daikon-cqrs/event-sourcing

View on GitHub
src/EventStore/Commit/CommitSequenceInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php declare(strict_types=1);
/**
 * This file is part of the daikon-cqrs/event-sourcing project.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Daikon\EventSourcing\EventStore\Commit;

use Countable;
use Daikon\EventSourcing\EventStore\Stream\Sequence;
use Daikon\Interop\FromNativeInterface;
use Daikon\Interop\MakeEmptyInterface;
use Daikon\Interop\ToNativeInterface;
use IteratorAggregate;

interface CommitSequenceInterface extends
    IteratorAggregate,
    Countable,
    MakeEmptyInterface,
    FromNativeInterface,
    ToNativeInterface
{
    public function push(CommitInterface $commit): self;

    public function getTail(): CommitInterface;

    public function getHead(): CommitInterface;

    public function get(Sequence $Sequence): CommitInterface;

    public function has(Sequence $Sequence): bool;

    public function getSlice(Sequence $start, Sequence $end): self;

    public function revisionOf(CommitInterface $commit): Sequence;
}