Last active
November 1, 2016 12:07
-
-
Save alanwillms/1fd1350acc048431ab5d to your computer and use it in GitHub Desktop.
Exemplo 2 de ISP em PHP
This file contains hidden or 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 | |
class EstoqueProduto | |
{ | |
... | |
public function retirar($quantidade) { ... } | |
public function depositar($quantidade) { ... } | |
public function getValor() { ... } | |
... | |
} | |
class ControleLogistica | |
{ | |
public function entrada(Fonecimento $fornecimento) | |
{ | |
.... | |
$estoque->depositar($quantidade); // EstoqueProduto::depositar | |
... | |
} | |
public function saida(Pedido $pedido) | |
{ | |
.... | |
$estoque->depositar($quantidade); // EstoqueProduto::retirar | |
... | |
} | |
} | |
class DemonstrativoContabilidade | |
{ | |
public function getPatrimonioLiquido() | |
{ | |
... | |
foreach ($estoques as $estoque) { | |
$patrimonio += $estoque->getValor(); // EstoqueProduto::getValor | |
} | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment