Last active
November 11, 2019 08:35
-
-
Save ciszu/5859b7942e3a54c069cc04e24bd13670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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