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 Notificacao | |
| { | |
| /** | |
| * Envia esta notificação por e-mail se o destinatário for válido. | |
| * @return boolean se a mensagem foi enviada com sucesso. | |
| */ | |
| public function enviar() | |
| { | |
| if (!$this->destinatario || !preg_match(EMAIL_REGEX, $this->destinatario)) { |
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 Impostometro | |
| { | |
| ... | |
| /** | |
| * Adiciona o valor dos impostos de um item | |
| * @param mixed $item | |
| * @return void | |
| */ |
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 ProdutoImportado extends Produto | |
| { | |
| ... | |
| } | |
| class Impostometro | |
| { | |
| ... | |
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 | |
| interface Tributavel | |
| { | |
| /** | |
| * Calcula o valor dos impostos que incidem sobre esta entidade. | |
| * @return float | |
| */ | |
| public function getValorImpostos(); | |
| } |
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 ProdutoExportado extends Produto | |
| { | |
| ... | |
| public function getValorImpostos() | |
| { | |
| return parent::getValorImpostos() + $this->getValorIE(); | |
| } | |
| } |
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 ClasseBase | |
| { | |
| public function metodo($a) { } // um parâmetro | |
| } | |
| class SubClasse extends ClasseBase | |
| { | |
| public function metodo($a, $b) { } // dois parâmetros | |
| } |
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 ClasseBase | |
| { | |
| public function __construct($a) { } // um parâmetro | |
| } | |
| class SubClasse extends ClasseBase | |
| { | |
| public function __construct($a, $b) { } // dois parâmetros | |
| } |
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 | |
| /** | |
| * Interface para meios de transporte para envio de um pedido. | |
| */ | |
| interface TransportePedidoInterface | |
| { | |
| /** | |
| * Envia um pedido. | |
| * @param Pedido $pedido pedido a ser enviado. | |
| * @return boolean se o pedido foi enviado com sucesso ou não. |
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 Logger | |
| { | |
| public function log($mensagem) | |
| { | |
| $this->append($mensagem); | |
| } | |
| } | |
| class DatabaseLogger extends Logger // sub-classe |
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 Logger | |
| { | |
| public function log($mensagem) | |
| { | |
| $this->append($mensagem); | |
| } | |
| } | |
| class DatabaseLogger extends Logger // sub-classe |