Last active
August 29, 2015 14:26
-
-
Save alanwillms/a56031d5b202d13d24b3 to your computer and use it in GitHub Desktop.
Liskov 1: PHP method overwriting
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 | |
| } | |
| // PHP Strict standards: | |
| // Declaration of SubClasse::metodo() should be compatible with ClasseBase::metodo($a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment