Last active
August 29, 2015 13:57
-
-
Save stivni/9455054 to your computer and use it in GitHub Desktop.
Sensible Interfaces
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 SrcFolder\LibraryNamespace | |
interface LibraryInterface | |
{ | |
public addItemMethod(ItemInterface $itemArgument) | |
public rentMethod(ItemInterface $itemArgument, ClientInterface $clientArgument); | |
} | |
interface ItemInterface | |
{ | |
public getIdentifierMethod(); | |
} | |
interface ClientInterface | |
{ | |
public getIdentifierMethod(); | |
} | |
class LibraryClass implements LibraryInterface | |
{ | |
private $inventoryProperty = []; | |
private $rentsProperty = []; | |
public function addItemMethod(ItemInterface $itemArgument) | |
{ | |
//... | |
} | |
public function rentItemMethod(ItemInterface $itemArgument, ClientInterface $clientArgument) | |
{ | |
//... | |
} | |
} | |
class BookClass implements ItemInterface | |
{ | |
private $isbnProperty; | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment