PHPackages                             snapshotpl/status-code - 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. snapshotpl/status-code

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

snapshotpl/status-code
======================

HTTP status code value object implementation in PHP

1.0.0(10y ago)113.9k[1 PRs](https://github.com/snapshotpl/status-code/pulls)1PHPPHP ^5.5 || ^7.0

Since Feb 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/snapshotpl/status-code)[ Packagist](https://packagist.org/packages/snapshotpl/status-code)[ RSS](/packages/snapshotpl-status-code/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (1)

status-code [![Build Status](https://camo.githubusercontent.com/ac155c2e421c384515dfd5c1787a996081680fd2f97e55de4d6bd11bf48d6081/68747470733a2f2f7472617669732d63692e6f72672f736e617073686f74706c2f7374617475732d636f64652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/snapshotpl/status-code)
=============================================================================================================================================================================================================================================================================================================

[](#status-code-)

HTTP status code value object implementation in PHP.

Features
--------

[](#features)

- validation,
- auto setup reason phrase (if known),
- immutable,
- support PSR-7 `Psr\Http\Message\ResponseInterface`.

Supported RFCs:

-
-
-
-
-
-
-
-
-
-
-

Supported drafts:

-

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

[](#installation)

Add to composer:

```
{
    "require": {
        "snapshotpl/status-code": "^1.0"
    }
}
```

Usage
-----

[](#usage)

```
$statusCode = new StatusCode(404);

$statusCode->isClientError(); // true
$statusCode->isRfc2516() // true
$statusCode->isServerError(); // false

echo $statusCode; // 404 Not Found
```

You can use it with anny PSR-7 implementation:

```
$response = new Zend\Diactoros\Response();
$statusCode = StatusCode::createFromResponse($response);
echo $statusCode; // 200 OK
```

```
$response = new Zend\Diactoros\Response();
$statusCode = new StatusCode(404, 'Not exists');
$newResponse = $statusCode->attachToResponse($response);
echo $newResponse->getStatusCode(); // 404
echo $newResponse->getReasonPhrase(); // Not exists
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

3785d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/312655?v=4)[Witold Wasiczko](/maintainers/snapshotpl)[@snapshotpl](https://github.com/snapshotpl)

---

Top Contributors

[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (5 commits)")

---

Tags

httppsr-7Value Objectstatus code

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/snapshotpl-status-code/health.svg)

```
[![Health](https://phpackages.com/badges/snapshotpl-status-code/health.svg)](https://phpackages.com/packages/snapshotpl-status-code)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B3.9k](/packages/guzzlehttp-psr7)[symfony/psr-http-message-bridge

PSR HTTP message bridge

1.3k320.9M967](/packages/symfony-psr-http-message-bridge)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

539238.7M44](/packages/league-uri-interfaces)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M124](/packages/mezzio-mezzio)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

587.2M99](/packages/laminas-laminas-stratigility)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

185702.8k42](/packages/laudis-neo4j-php-client)

PHPackages © 2026

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