PHP和PSR-8中的HuggableInterface
发布时间:2020-12-13 16:24:30 所属栏目:PHP教程 来源:网络整理
导读:在 PHP Framework Interop Group site(PSR的维护者),有一个草稿 PSR-8 Huggable Interface: namespace PsrHug;/** * Defines a huggable object. * * A huggable object expresses mutual affection with another huggable object. */interface Huggable{
在
PHP Framework Interop Group site(PSR的维护者),有一个草稿
PSR-8 Huggable Interface:
namespace PsrHug; /** * Defines a huggable object. * * A huggable object expresses mutual affection with another huggable object. */ interface Huggable { /** * Hugs this object. * * All hugs are mutual. An object that is hugged MUST in turn hug the other * object back by calling hug() on the first parameter. All objects MUST * implement a mechanism to prevent an infinite loop of hugging. * * @param Huggable $h * The object that is hugging this object. */ public function hug(Huggable $h); } 草案很短,但没有提供任何实施的例子.实现这个界面的目的是什么?
正玩得开心!
请参阅合并日期:
这是一个笑话:)(四月愚人节) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |