Skip to content

Instantly share code, notes, and snippets.

@tomphp
Last active August 29, 2015 13:58
Show Gist options
  • Save tomphp/9991824 to your computer and use it in GitHub Desktop.
Save tomphp/9991824 to your computer and use it in GitHub Desktop.
Interface typing
<?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