PHPackages                             slepic/psr-http-observing-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. slepic/psr-http-observing-client

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

slepic/psr-http-observing-client
================================

PSR ClientInterface implementation that wraps another implementation and observes the transfers using ObserverInterfce from slepic/http-transfer package.

0.1.0(6y ago)054BSD-3-ClausePHPPHP ^7.0

Since Jul 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/slepic/psr-http-observing-client)[ Packagist](https://packagist.org/packages/slepic/psr-http-observing-client)[ RSS](/packages/slepic-psr-http-observing-client/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/aee2cabd47fe742f861b46a519b006c8e1db0485a607f577c6e37fdf7cb4e317/68747470733a2f2f7472617669732d63692e6f72672f736c657069632f7073722d687474702d6f6273657276696e672d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slepic/psr-http-observing-client)[![Style Status](https://camo.githubusercontent.com/f55ac142a4a8c3c9e18f693ed9df5df0d7c07e9225a4fb630d322815aad7ba15/68747470733a2f2f7374796c6563692e696f2f7265706f732f3138343434383034302f736869656c64)](https://styleci.io/repos/184448040)

psr-http-observing-client
=========================

[](#psr-http-observing-client)

PSR ClientInterface implementation that wraps another implementation and observes the transfers using ObserverInterfce from slepic/http-transfer package.

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

[](#requirements)

PHP 7

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

[](#installation)

Install with composer

`composer require slepic/psr-http-observing-client`

Usage
-----

[](#usage)

Wrap any instance of [`\Psr\Http\Client\ClientInterface`](https://github.com/php-fig/http-client/blob/master/src/ClientInterface.php) with the [`\Slepic\Psr\Http\ObservingClient\ObservingClient`](https://github.com/slepic/psr-http-observing-client/blob/master/src/ObservingClient.php) and pass it a [`\Slepic\Http\Transfer\Observer\ObserverInterface`](https://github.com/slepic/http-transfer/blob/master/src/Observer/ObserverInterface.php) from package [`slepic/http-transfer`](https://packagist.org/packages/slepic/http-transfer).

If you now send all your requests through the ObservingClient, the observer will be notified about start and end of all the transfers.

See an example where we use [`\Slepic\Http\Transfer\History\HistoryObserver`](https://github.com/slepic/http-transfer/blob/master/src/History/HistoryObserver.php) to log requests and responses with timing.

```
$storage = new ArrayStorage();
$observer = new HistoryObserver($storage);
$psrClient = new SomePsrClient();
$client = new ObservingClient($psrClient, $observer);

try {
$response = $client->sendRequest($request);
} catch (\Exception $e) {
  assert($storage[0]->getRequest() === $request);
  assert($storage[0]->getException() === $e);
  assert(0 < ($storage[0]->getEndTime() - $storage[0]->getStartTime()));
  throw $e;
}

assert($storage[0]->getRequest() === $request);
assert($storage[0]->getResponse() === $response);
assert(0 < ($storage[0]->getEndTime() - $storage[0]->getStartTime()));

```

Observers
---------

[](#observers)

See [`slepic/http-transfer-observer-implementation`](https://packagist.org/providers/slepic/http-transfer-observer-implementation) for list of existing observers.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

2503d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/slepic-psr-http-observing-client/health.svg)

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

###  Alternatives

[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)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[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)
