On the PHP Framework Interop Group site (the maintainer of PSRs), there is a draft PSR-8 Huggable Interface:
namespace Psr\Hug;
/**
* 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);
}
The draft is quite short but does not provide any examples of implementation. What is the purpose of implementing this interface?
Having fun!
See merge date:
It's a joke :) (April fools' day.)