PHPackages                             hack-psr/psr7-http-message-hhi - 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. hack-psr/psr7-http-message-hhi

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

hack-psr/psr7-http-message-hhi
==============================

Typechecker definitions for PSR-7

v1.0.1(8y ago)8678.1k↓33.3%26MIT

Since Aug 28Pushed 8y ago4 watchersCompare

[ Source](https://github.com/fredemmott/psr7-http-message-hhi)[ Packagist](https://packagist.org/packages/hack-psr/psr7-http-message-hhi)[ Docs](https://github.com/fredemmott/psr7-http-message-hhi)[ RSS](/packages/hack-psr-psr7-http-message-hhi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (6)

HHI Definitions For PSR7, HTTP Messages
=======================================

[](#hhi-definitions-for-psr7-http-messages)

This repository contains .hhi files for the interfaces defined in PSR-7. It is based on the PHP interface definitions and comments available here:

HHI files are ignored by HHVM, however they give the typechecker information about the interfaces. This allows usage of the canonical PHP interface at runtime, while also giving the benefits of static type checking.

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

[](#installation)

```
composer require hack-psr/psr7-http-message-hhi

```

Notes
-----

[](#notes)

- `RequestInterface::getRequestTarget()` is marked as `@return string`, however this is not always accurate, given that `RequestInterface::withRequestTarget()` explicitly allows any type for the request target, which must be preserved verbatim -
- `ServerRequestInterface::getParsedBody()` is specified as returning `null|array|object` so is typed here as `mixed`. There has been some discussion about banning the `object` case as any usage couples you to a specific implementation or stack, which would allow it to be typed as `?array`. This is not done because PHP implementations would not have to honor this type.
- `ServerRequestInterface::getQueryParams()` and `getUploadedFiles()` return untyped arrays as they return a tree-like structure instead of a key-value structure - eg `?a[b][c]=123`. They could be typed as `array`, however this would make them much more inconvenient to use.
- The return value of these functions is not defined in PSR7; this project defines them as returning `void` to prevent users depending on unspecified behavior ():
    - `StreamInterface::seek()`
    - `StreamInterface::rewind()`
    - `UploadedFileInterface::moveTo()`
- The combination of these means that the most user-friendly (and safe) hack definition of this interface isn't suitable for use by implementations (see #2)

Future Work
-----------

[](#future-work)

Create a derived standard for Hack, addressing the above notes. Ideas include:

- banning non-string request targets
- banning `object` parsed bodies
- flattening `getUploadedFiles`, `getParsedBody`, `getQueryParams`

This would be a separate project.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~298 days

Total

4

Last Release

3010d ago

Major Versions

v0.2 → v1.0.02016-09-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/601530?v=4)[Yang, Bo](/maintainers/Atry)[@Atry](https://github.com/Atry)

![](https://avatars.githubusercontent.com/u/727402?v=4)[Alexey Toptygin](/maintainers/alexeyt)[@alexeyt](https://github.com/alexeyt)

---

Top Contributors

[![fredemmott](https://avatars.githubusercontent.com/u/360927?v=4)](https://github.com/fredemmott "fredemmott (18 commits)")[![doublecompile](https://avatars.githubusercontent.com/u/4267230?v=4)](https://github.com/doublecompile "doublecompile (1 commits)")

---

Tags

psrpsr-7http-messagepsr7hhvmhackhhi

### Embed Badge

![Health badge](/badges/hack-psr-psr7-http-message-hhi/health.svg)

```
[![Health](https://phpackages.com/badges/hack-psr-psr7-http-message-hhi/health.svg)](https://phpackages.com/packages/hack-psr-psr7-http-message-hhi)
```

###  Alternatives

[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M272](/packages/fig-http-message-util)[laminas/laminas-psr7bridge

Bidirectional conversions between PSR-7 and laminas-http messages

117.9M18](/packages/laminas-laminas-psr7bridge)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

153.3k](/packages/art4-requests-psr18-adapter)

PHPackages © 2026

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