Reputation: 46307
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?
Upvotes: 13
Views: 2580
Reputation: 15435
I started an implementation here: https://github.com/dave1010/php-fig-psr-8
It's not quite finished (contributors welcome!) but already useful if you need a PSR-8 implementation in your projects.
Upvotes: 6
Reputation: 1823
Having fun!
See merge date:
Crell on Apr 1, 2014 Merge in interface definitions.
It's a joke :) (April fools' day.)
Upvotes: 24