Last active
August 29, 2015 13:58
-
-
Save tomphp/9991824 to your computer and use it in GitHub Desktop.
Interface typing
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 | |
/* | |
* Since we don't have method over loading, shouldn't this be possible? | |
*/ | |
interface Object1Saver | |
{ | |
public function save(Object1 $obj); | |
} | |
interface Object2Saver | |
{ | |
public function save(Object2 $obj); | |
} | |
class Saver implements Object1Saver, Object2Saver | |
{ | |
public function save($object) | |
{ | |
// do saving stuff | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment