Created
July 25, 2015 13:09
-
-
Save Bolinha1/908329f92717a37b7ab8 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 | |
abstract class Resposta | |
{ | |
protected $formatoResposta; | |
protected $proxima; | |
public function enviarResposta(Conta $conta, Requisicao $requisicao) | |
{ | |
if($requisicao->getFormato() != $this->formatoResposta && $this->proxima != NULL) | |
return $this->proxima->enviarResposta($conta, $requisicao); | |
return $this->responder($conta, $requisicao); | |
} | |
public function setProxima(Resposta $resposta) | |
{ | |
return $this->proxima = $resposta; | |
} | |
protected abstract function responder(Conta $conta, Requisicao $requisicao); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment