PHPackages                             riftfox/php-http-client - 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. riftfox/php-http-client

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

riftfox/php-http-client
=======================

A lightweight PSR-18 HTTP client wrapper allowing custom response transformation via result factories.

v0.1.0(6mo ago)00MITPHP

Since Dec 26Pushed 6mo agoCompare

[ Source](https://github.com/riftfox/php-http-client)[ Packagist](https://packagist.org/packages/riftfox/php-http-client)[ RSS](/packages/riftfox-php-http-client/feed)WikiDiscussions main Synced today

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

Riftfox PHP HTTP Client
=======================

[](#riftfox-php-http-client)

A lightweight PSR-18 HTTP client wrapper allowing custom response transformation via result factories.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- A PSR-18 HTTP Client implementation (e.g., Guzzle, Symfony HttpClient)
- PSR-7 HTTP Message implementation

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

[](#installation)

```
composer require riftfox/php-http-client
```

Usage
-----

[](#usage)

This library separates the HTTP transport (PSR-18) from the response processing logic (ResultFactory).

### 1. Create a Result and a Factory

[](#1-create-a-result-and-a-factory)

Implement `ResultInterface` for your data object and `ResultFactoryInterface` to transform the PSR-7 response into that object.

```
namespace App\Http;

use Riftfox\HttpClient\ResultInterface;
use Riftfox\HttpClient\ResultFactoryInterface;
use Psr\Http\Message\ResponseInterface;

class UserResult implements ResultInterface
{
    public array $data;

    public function __construct(array $data)
    {
        $this->data = $data;
    }
}

class UserResultFactory implements ResultFactoryInterface
{
    public function create(ResponseInterface $response): ResultInterface
    {
        $json = (string) $response->getBody();
        $data = json_decode($json, true);

        return new UserResult($data ?? []);
    }
}
```

### 2. Send a Request

[](#2-send-a-request)

```
use Riftfox\HttpClient\HttpClient;
use GuzzleHttp\Client as GuzzleClient; // Example PSR-18 Client
use GuzzleHttp\Psr7\Request;

// 1. Initialize the PSR-18 client and your wrapper
$psrClient = new GuzzleClient();
$client = new HttpClient($psrClient);

// 2. Prepare the request and the factory
$request = new Request('GET', 'https://api.example.com/users/1');
$factory = new UserResultFactory();

// 3. Send request and get the transformed result directly
/** @var UserResult $result */
$result = $client->send($request, $factory);

print_r($result->data);
```

Testing
-------

[](#testing)

Run the test suite with Codeception:

```
vendor/bin/codecept run unit
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance68

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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

190d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/207349619?v=4)[Riftfox](/maintainers/Riftfox)[@riftfox](https://github.com/riftfox)

---

Top Contributors

[![riftfox](https://avatars.githubusercontent.com/u/207349619?v=4)](https://github.com/riftfox "riftfox (2 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/riftfox-php-http-client/health.svg)

```
[![Health](https://phpackages.com/badges/riftfox-php-http-client/health.svg)](https://phpackages.com/packages/riftfox-php-http-client)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[laudis/neo4j-php-client

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

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

PHPackages © 2026

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