Skip to content

Instantly share code, notes, and snippets.

@ciszu
Last active November 11, 2019 08:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<?php
namespace Mozartify\Subscription;
interface Storage
{
// ...
public function createNewTenant(string $tenantName);
public function addPackage(int $subscriptionId, string $packageType);
}
class MyReadOnlyStorage implements Storage
{
public function createNewTenant(string $tenantName)
{
// TODO: Implement createNewTenant() method.
}
public function addPackage(int $subscriptionId, string $packageType)
{
throw new Exception('Read Only Driver');
}
// ...
}
class UseCaseImpl
{
// ...
public function execute()
{
$this->storage->createNewTenant('name');
$this->storage->addPackage(1, 'demo');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment