Skip to content

Instantly share code, notes, and snippets.

@alanwillms
Last active August 29, 2015 14:26
Show Gist options
  • Save alanwillms/a56031d5b202d13d24b3 to your computer and use it in GitHub Desktop.
Save alanwillms/a56031d5b202d13d24b3 to your computer and use it in GitHub Desktop.
Liskov 1: PHP method overwriting
<?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