Untitled

mail@pastecode.io avatar
unknown
php
3 years ago
406 B
1
Indexable
Never
<?php

declare(strict_types=1);

namespace Mohawk\Microblog\Domain;

use Mohawk\Microblog\Domain\Author\Username;

class AuthorSpecification
{
    private Authors $authors;

    public function __construct(Authors $authors)
    {
        $this->authors = $authors;
    }

    public function isSatisfiedBy(Username $username) : bool
    {
        return $this->authors->exists($username) === false;
    }
}