PHPackages                             free-elephants/static-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. free-elephants/static-http-client

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

free-elephants/static-http-client
=================================

PSR-18 implementation for work with file fixtures

0.0.3(1y ago)0488BSD-3-ClausePHPCI passing

Since Apr 22Pushed 1y ago3 watchersCompare

[ Source](https://github.com/FreeElephants/static-http-client)[ Packagist](https://packagist.org/packages/free-elephants/static-http-client)[ RSS](/packages/free-elephants-static-http-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (7)Used By (0)

Static Http Client
==================

[](#static-http-client)

[PSR-18](http://www.php-fig.org/psr/psr-18) implementation for testing. Use static files for mock responses and write requests.

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

[](#installation)

```
composer require free-elephants/static-http-client --dev
```

Usage
-----

[](#usage)

See tests for more examples.

```
public function test()
{
    $stubbedHttpClient = new \FreeElephants\StaticHttpClient\StaticHttpClient(
        $responseFactory,
        new \FreeElephants\StaticHttpClient\PathResolver\PathBuilderBasedResolver(
            new \FreeElephants\StaticHttpClient\PathBuilder\Composite(
                new \FreeElephants\StaticHttpClient\PathBuilder\PrependBasePath(__DIR__),
                new \FreeElephants\StaticHttpClient\PathBuilder\PrependHostnameAsDirectory(),
                new \FreeElephants\StaticHttpClient\PathBuilder\AppendRequestPath(),
                new \FreeElephants\StaticHttpClient\PathBuilder\AppendDefaultFileExtension('.json'),
            )
        )
    );

    $response = $stubbedHttpClient->sendRequest(new \Nyholm\Psr7\Request('GET', 'https://example.com/foo')); // resolved as __DIR__ . '/example.com/foo.json'
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance48

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity31

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

Every ~2 days

Total

3

Last Release

388d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b764f6cd1eb52054cf0e07297309c60e37382542268822b3bd5edd97729d056?d=identicon)[samizdam](/maintainers/samizdam)

---

Top Contributors

[![samizdam](https://avatars.githubusercontent.com/u/1556299?v=4)](https://github.com/samizdam "samizdam (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/free-elephants-static-http-client/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.0B3.2k](/packages/guzzlehttp-psr7)[league/uri

URI manipulation library

1.1k206.4M277](/packages/league-uri)[php-http/client-common

Common HTTP Client implementations and tools for HTTPlug

1.1k225.5M571](/packages/php-http-client-common)[laudis/neo4j-php-client

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

184616.9k31](/packages/laudis-neo4j-php-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[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)
