Skip to content

Instantly share code, notes, and snippets.

@ciszu
Last active November 11, 2019 08:35
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 ciszu/5859b7942e3a54c069cc04e24bd13670 to your computer and use it in GitHub Desktop.
Save ciszu/5859b7942e3a54c069cc04e24bd13670 to your computer and use it in GitHub Desktop.
<?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