Created
October 2, 2015 19:03
-
-
Save alanwillms/9481921000e97ac8c865 to your computer and use it in GitHub Desktop.
User class after null object (based on an Upcase example)
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 Usuario | |
| { | |
| public function cobrar() | |
| { | |
| $this->assinatura->cobrar($this->getCartaoCredito()); // sem testar por null! | |
| } | |
| public function isPremium() | |
| { | |
| $this->assinatura->isPremium(); // sem testar por null! | |
| } | |
| public function getValorCobrado() | |
| { | |
| return $this->assinatura->getValor(); // sem testar por null! | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment