https://github.com/navarr/hugger
PSR-8 Implementation
https://github.com/navarr/hugger
Last synced: 5 months ago
JSON representation
PSR-8 Implementation
- Host: GitHub
- URL: https://github.com/navarr/hugger
- Owner: navarr
- Created: 2021-08-29T03:27:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-30T13:40:35.000Z (over 3 years ago)
- Last Synced: 2024-12-29T06:22:23.797Z (7 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hugger (PSR-8)
[](https://packagist.org/packages/navarr/hugger)
[](https://packagist.org/packages/navarr/hugger)
[](https://packagist.org/packages/navarr/hugger)
[](https://packagist.org/packages/navarr/hugger)

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
```php
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]);
```