note 118019 added to language.oop5.interfaces
| From: | naderi dot payam at gmail dot com | Date: | Sat, 19 Sep 2015 12:44:53 +0000 |
| Subject: | note 118019 added to language.oop5.interfaces | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203814@lists.php.net to get a copy of this message | ||
php inheritance interfaces on function/methods 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());
?>
----
Server IP: 72.52.91.14
Probable Submitter: 5.116.118.186
----
Manual Page -- http://php.net/manual/en/language.oop5.interfaces.php
Edit -- https://master.php.net/note/edit/118019
Del: integrated -- https://master.php.net/note/delete/118019/integrated
Del: useless -- https://master.php.net/note/delete/118019/useless
Del: bad code -- https://master.php.net/note/delete/118019/bad+code
Del: spam -- https://master.php.net/note/delete/118019/spam
Del: non-english -- https://master.php.net/note/delete/118019/non-english
Del: in docs -- https://master.php.net/note/delete/118019/in+docs
Del: other reasons-- https://master.php.net/note/delete/118019
Reject -- https://master.php.net/note/reject/118019
Search -- https://master.php.net/manage/user-notes.php