Skip to content

Instantly share code, notes, and snippets.

@alanwillms
Last active November 1, 2016 12:06
Show Gist options
  • Save alanwillms/89d9ea76b925ba3ed37f to your computer and use it in GitHub Desktop.
Save alanwillms/89d9ea76b925ba3ed37f to your computer and use it in GitHub Desktop.
Exemplo 1 de ISP em PHP
<?php
class EstoqueProduto
{
...
public function retirar($quantidade) { ... }
public function depositar($quantidade) { ... }
public function getValor() { ... }
...
}
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