Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/navarr/hugger
PSR-8 Implementation
https://github.com/navarr/hugger
Last synced: about 6 hours ago
JSON representation
PSR-8 Implementation
- Host: GitHub
- URL: https://github.com/navarr/hugger
- Owner: navarr
- Created: 2021-08-29T03:27:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-30T13:40:35.000Z (almost 3 years ago)
- Last Synced: 2024-05-01T19:32:11.297Z (6 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)
[![Latest Stable Version](http://poser.pugx.org/navarr/hugger/v)](https://packagist.org/packages/navarr/hugger)
[![Total Downloads](http://poser.pugx.org/navarr/hugger/downloads)](https://packagist.org/packages/navarr/hugger)
[![Latest Unstable Version](http://poser.pugx.org/navarr/hugger/v/unstable)](https://packagist.org/packages/navarr/hugger)
[![License](http://poser.pugx.org/navarr/hugger/license)](https://packagist.org/packages/navarr/hugger)
![Tests](https://github.com/navarr/hugger/actions/workflows/commit.yml/badge.svg)
![Code Coverage](https://codecov.io/gh/navarr/hugger/branch/main/graph/badge.svg?token=BHTKOZZDR3)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]);
```