PHPackages                             phprise/http-value-object - 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. phprise/http-value-object

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

phprise/http-value-object
=========================

Atomic Repository for Value Object of HTTP Connector based on the OTAKU Manifesto.

v1.0.0(3mo ago)033MITPHPPHP ^8.4

Since Jan 22Pushed 3mo agoCompare

[ Source](https://github.com/phprise-foundation/http-value-object)[ Packagist](https://packagist.org/packages/phprise/http-value-object)[ RSS](/packages/phprise-http-value-object/feed)WikiDiscussions 1.x Synced 1mo ago

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

phprise/http-value-object
=========================

[](#phprisehttp-value-object)

The Atomic Repository is the smallest possible unit of granularity. It enforces a strict architectural boundary through the following rules:

1. **No Subdirectories**: Only one level of directory inside src/.
2. **Maximum 10 Files**: Only 10 files per package.
3. **Strict Typing**: Mandatory `declare(strict_types=1)` and full type hinting for all properties and methods.
4. **Object Calisthenics**: Maximum of 50 lines per class and 2 instance variables to ensure extreme cohesion.
5. **Value Objects**: All primitives must be wrapped. Raw strings or integers are not permitted in domain logic.
6. **First Class Collections**: Arrays are forbidden for data transport; use dedicated Collection objects.
7. **Tell, Don't Ask**: Getters and setters are prohibited. Objects must expose behavior, not state.
8. **Infrastructure Ignorance**: The domain core is decoupled from persistence, frameworks, and external tools.
9. **Logic Flow**: The `else` keyword is banned. Use guard clauses and early returns to minimize indentation.

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

[](#installation)

Install the package via Composer:

```
composer require phprise/http-value-object
```

Usage
-----

[](#usage)

This repository provides fundamental HTTP value objects. It is an **Atom**, designed to be immutable, strictly typed, and free of complex business logic.

### Headers

[](#headers)

Headers are handled strictly. All names are normalized to lowercase.

```
use Phprise\Http\ValueObject\Headers;

$headers = new Headers([
    'Content-Type' => ['application/json']
]);

// Immutably add a header
$newHeaders = $headers->with('Authorization', 'Bearer token');

if ($newHeaders->has('authorization')) {
    $values = $newHeaders->get('authorization');
}

$array = $newHeaders->toArray();
```

### Uri

[](#uri)

A robust implementation of `Psr\Http\Message\UriInterface`.

```
use Phprise\Http\ValueObject\Uri;

$uri = new Uri('https://api.example.com/v1/users?query=otaku');

echo $uri->getHost(); // api.example.com
echo $uri->getPath(); // /v1/users

// Immutably change the path
$newUri = $uri->withPath('/v2/users');
```

Tip

This atom is meant to be split into even smaller units as the system evolves, ensuring that each component contains zero complex logic and serves only as a structured data container.

### Available Components

[](#available-components)

- **Headers**: Immutable collection of HTTP headers with normalization.
- **Uri**: Robust PSR-7 compliant URI implementation.
- **Streams**: `NativeStream`, `JsonStream`, and `EmptyStream` for payload handling.
- **NativeResponse**: Simple wrapper for native PHP response handling.
- **RequestContext**: Value object to encapsulate HTTP request metadata.

Philosophy
----------

[](#philosophy)

We follow **The OTAKU Manifesto: Fluid Structure Design**.

1. **O** - Own your Discipline (Be strict with yourself)
2. **T** - Tools for Composition (Compose like Unix)
3. **A** - Armor the Core (Protect the heart of the business)
4. **K** - Keep Infrastructure Silent (Infrastructure is just a detail)
5. **U** - Universal Language &amp; Contracts (Speak the user's language via clear contracts)

Please read more about it in [PHILOSOPHY.md](PHILOSOPHY.md).

License
-------

[](#license)

MIT License

Free to use, modify, and distribute.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance78

Regular maintenance activity

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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 ~0 days

Total

2

Last Release

116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b1815540bc9ab8012b61aa12e1a35025d9a0b11a1642977192fd173b6bfc5aa?d=identicon)[esdras-schonevald](/maintainers/esdras-schonevald)

---

Top Contributors

[![esdras-schonevald](https://avatars.githubusercontent.com/u/64711203?v=4)](https://github.com/esdras-schonevald "esdras-schonevald (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phprise-http-value-object/health.svg)

```
[![Health](https://phpackages.com/badges/phprise-http-value-object/health.svg)](https://phpackages.com/packages/phprise-http-value-object)
```

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[laudis/neo4j-php-client

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

184616.9k31](/packages/laudis-neo4j-php-client)[http-interop/response-sender

A function to convert PSR-7 Response to HTTP output

46711.5k40](/packages/http-interop-response-sender)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)

PHPackages © 2026

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