Skip to content

Instantly share code, notes, and snippets.

@siljanoskam
Created April 25, 2020 16:50
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 siljanoskam/059f0f747bc60fa493f243346d73d386 to your computer and use it in GitHub Desktop.
Save siljanoskam/059f0f747bc60fa493f243346d73d386 to your computer and use it in GitHub Desktop.
Repository interface
<?php
namespace App\Repositories;
class Repository implements RepositoryInterface
{
protected $items = [];
protected $error = false;
public function getItems()
{
return $this->items;
}
public function setItems($items): Repository
{
$this->items = $items;
return $this;
}
public function setError(Bool $error): Repository
{
$this->error = $error;
return $this;
}
public function hasError(): Bool
{
return $this->error;
}
}
<?php
namespace App\Repositories;
interface RepositoryInterface
{
public function getItems();
public function setItems($items);
public function setError(Bool $error);
public function hasError(): Bool;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment