Flow2Lab/EventSourcing

View on GitHub
Classes/Flow2Lab/EventSourcing/Command/Command.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
namespace Flow2Lab\EventSourcing\Command;

use Flow2Lab\EventSourcing\Uuid;

class Command implements CommandInterface
{

    /**
     * @var string
     */
    public $commandId;

    public function __construct()
    {
        $this->commandId = Uuid::next();
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return get_class($this) . ':' . $this->commandId;
    }

}