Ettore Delprino (@edelprino)
InMemory Repository
class InMemoryProductRepository implements ProductRepositoryInterface
{
protected $products;
public function __construct()
{
$this->products = [
$this->getNewProduct(‘Prodotto0’, 10),
$this->getNewProduct(‘Prodotto1’, 20)
];
}
public function save(Product $product)
{
$this->setId($product);
$this->products[] = $product;
}
...