Skip to content

Instantly share code, notes, and snippets.

@E1101
Created September 19, 2015 12:49
Show Gist options
  • Save E1101/e33d828b78659983c837 to your computer and use it in GitHub Desktop.
Save E1101/e33d828b78659983c837 to your computer and use it in GitHub Desktop.
php inheritance interface type declarations
<?php
interface iInvokable {
function __invoke($arg = null);
}
interface iResponder extends iInvokable {
/** Bind next responder */
function then(iInvokable $responder);
}
class Responder implements \iResponder {
function __invoke($arg = null)
{
// TODO: Implement __invoke() method.
}
/** Bind next responder */
function then(iInvokable $responder)
{
// TODO: Implement then() method.
}
}
class OtherResponder implements \iResponder {
function __invoke($arg = null)
{
// TODO: Implement __invoke() method.
}
/** Bind next responder */
function then(iInvokable $responder)
{
// TODO: Implement then() method.
}
}
class Invokable implements \iInvokable {
function __invoke($arg = null)
{
// TODO: Implement __invoke() method.
}
}
$responder = new Responder();
$responder->then(new OtherResponder());
$responder->then(new Invokable());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment