Skip to content

Instantly share code, notes, and snippets.

@mdzwigala
Created December 4, 2020 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdzwigala/85509f42c03883b5a67452ff5d1eb996 to your computer and use it in GitHub Desktop.
Save mdzwigala/85509f42c03883b5a67452ff5d1eb996 to your computer and use it in GitHub Desktop.
ADR-EXAMPLE\Infrastructure\InMemoryUsers
<?php
declare(strict_types=1);
namespace App\Infrastructure\Storage\InMemory;
use App\Domain\Model\User;
use App\Domain\Model\Users;
final class InMemoryUsers implements Users
{
private array $users = [];
public function add(User $user)
{
$this->users[$user->id()] = $user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment