PHPackages                             tdt/negotiators - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tdt/negotiators

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tdt/negotiators
===============

A package to do content and language negotiation.

v1.0.2(13y ago)08631AGPLv3PHPPHP &gt;=5.3.0

Since Jan 20Pushed 13y ago5 watchersCompare

[ Source](https://github.com/tdt/negotiators)[ Packagist](https://packagist.org/packages/tdt/negotiators)[ Docs](http://thedatatank.com)[ RSS](/packages/tdt-negotiators/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

tdt/negotiators
===============

[](#tdtnegotiators)

[![Build Status](https://camo.githubusercontent.com/44cb41178b59d4644b14b397c7f4f98607520f865acecbad0f355a27a35e9135/68747470733a2f2f7472617669732d63692e6f72672f7464742f6e65676f746961746f72732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/tdt/negotiators)

Content and language negotiation written in PHP: GET parameters will overwrite accept header. Support for logging (monolog).

Installation
============

[](#installation)

Install as a requirement using composer:

1. Add a composer.json in your root
2. Add a requirement:

```
{
  "require" : {
     "tdt/negotiators" : "1.0.*"
  }
}
```

3. Install composer:
4. run "composer install"
5. include vendor/autoload.php

Usage
=====

[](#usage)

```
$cn = new \tdt\negotiators\ContentNegotiator();
$format = $cn->pop();
$default_format = "json";

// $this->formatAllowed is a function you have to define yourself
while (!$this->formatAllowed($format) && $cn->hasNext()) {
    $format = $cn->pop();
}

if(! $this->formatAllowed($format)){
     throw new Exception("Could not find an appropriate formatter.");
}

// use $format further on
```

Testing
=======

[](#testing)

Using phpunit:

```
$ phpunit tests
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~16 days

Total

3

Last Release

4835d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea7deaa6beab35e56598e71e03d8ca3560856815c7aff95269f85eb572f3c8ac?d=identicon)[coreation](/maintainers/coreation)

---

Top Contributors

[![coreation](https://avatars.githubusercontent.com/u/361244?v=4)](https://github.com/coreation "coreation (3 commits)")[![pietercolpaert](https://avatars.githubusercontent.com/u/347073?v=4)](https://github.com/pietercolpaert "pietercolpaert (1 commits)")

---

Tags

content negotiationlanguage negotiation

### Embed Badge

![Health badge](/badges/tdt-negotiators/health.svg)

```
[![Health](https://phpackages.com/badges/tdt-negotiators/health.svg)](https://phpackages.com/packages/tdt-negotiators)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[uspdev/replicado

Classes PHP que consome dados do Replicado USP

136.2k7](/packages/uspdev-replicado)

PHPackages © 2026

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