PHPackages                             rmiller/hal-guzzle-response - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. rmiller/hal-guzzle-response

ActiveLibrary[HTTP &amp; Networking](/categories/http)

rmiller/hal-guzzle-response
===========================

Adds Hal resources to Guzzle Responses

0.4.0(10y ago)47651MITPHPPHP &gt;=5.4

Since Nov 17Pushed 10y ago2 watchersCompare

[ Source](https://github.com/richardmiller/HalGuzzleResponse)[ Packagist](https://packagist.org/packages/rmiller/hal-guzzle-response)[ Docs](https://github.com/richardmiller/HalGuzzleResponse)[ RSS](/packages/rmiller-hal-guzzle-response/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

HalGuzzleResponse
=================

[](#halguzzleresponse)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e6b4ba07910f97b5dd0c5336710c639e0106744648c2d7036bc42e55afaa386e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726963686172646d696c6c65722f48616c47757a7a6c65526573706f6e73652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/richardmiller/HalGuzzleResponse/?branch=master)[![Build Status](https://camo.githubusercontent.com/808499deb115b80f71ce750b8980865bee0bd51f2a386b50e4ee64e6a736591a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726963686172646d696c6c65722f48616c47757a7a6c65526573706f6e73652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/richardmiller/HalGuzzleResponse/build-status/master)

[Guzzle](https://github.com/guzzle/guzzle) event subscriber to decorate responses to provide Hal resources.

If you register the listener it will decorate the responses from Guzzle giving them a `hal` method. This will return a [Nocarrier\\Hal](https://github.com/blongden/hal)resource created from the response body.

Installation
------------

[](#installation)

Require the extension:

```
$ composer require rmiller/hal-guzzle-response:~0.1

```

Usage
-----

[](#usage)

Attach the listener:

```
$client = new \GuzzleHttp\Client();
$emitter = $client->getEmitter();
$subscriber = new \RMiller\HalGuzzleResponse\GuzzleSubscriber();
$emitter->attach($subscriber);
```

Get the Hal resource from the response:

```
$response = $client->get($url);
$hal = $response->hal(); //\Nocarrier\Hal
```

Note: an attempt will be made to convert the response body from JSON and XML to a Hal resource. If neither is successful a `\RuntimeException` will be thrown. This happens when `hal` is called, so it is safe to wrap other responses and not call `hal`.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~297 days

Total

2

Last Release

3894d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/442882d0e62a3acd7f3480cc8a07beeb3098dadbaaecb501eea945374ce55e1b?d=identicon)[mr\_r\_miller](/maintainers/mr_r_miller)

---

Top Contributors

[![richardmiller-zz](https://avatars.githubusercontent.com/u/783827?v=4)](https://github.com/richardmiller-zz "richardmiller-zz (12 commits)")

---

Tags

Guzzlehal

### Embed Badge

![Health badge](/badges/rmiller-hal-guzzle-response/health.svg)

```
[![Health](https://phpackages.com/badges/rmiller-hal-guzzle-response/health.svg)](https://phpackages.com/packages/rmiller-hal-guzzle-response)
```

###  Alternatives

[kevinrob/guzzle-cache-middleware

A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)

43117.4M104](/packages/kevinrob-guzzle-cache-middleware)[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[guzzlehttp/oauth-subscriber

Guzzle OAuth 1.0 subscriber

24114.5M141](/packages/guzzlehttp-oauth-subscriber)[caseyamcl/guzzle_retry_middleware

Guzzle v6+ retry middleware that handles 429/503 status codes and connection timeouts

21610.7M64](/packages/caseyamcl-guzzle-retry-middleware)[php-http/guzzle7-adapter

Guzzle 7 HTTP Adapter

9057.1M554](/packages/php-http-guzzle7-adapter)[graham-campbell/guzzle-factory

Provides A Simple Guzzle Factory With Good Defaults

916.4M49](/packages/graham-campbell-guzzle-factory)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
