navarr / hugger
PSR-8 Implementation
Fund package maintenance!
navarr
Requires
- php: >=8
- psr/hug: ^1
Requires (Dev)
- infection/infection: ^0.24.0
- navarr/fig-hug-interfaces: 1.0.x-dev
- phpstan/phpstan: ^1
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^3.6
Provides
- psr/hug-implementation: 1.0-dev
This package is auto-updated.
Last update: 2024-11-29 06:47:16 UTC
README
This is an implementation of PSR-8. This package includes a Hugger class (which is always happy to hug), as well as a GroupHuggableTrait, so you can add hugging functionality to any class.
Installation
Until such time as PSR-8 is un-abandoned, you need to install both my own implementation of its interfaces, as well as this hugging library.
composer require navarr/psr-hug-interfaces:@dev navarr/hugger:@dev
Usage
class ClassThatWantsToHug { use \Navarr\Hugger\GroupHuggableTrait; } $hugger = new ClassThatWantsToHug(); $otherHugger = new \Navarr\Hugger\Hugger(); $hugger->hug($otherHugger); // Hugger will call $otherHugger->hug($other) $hugger->groupHug([$otherHugger]);