PHPackages                             elife/content-negotiator - 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. elife/content-negotiator

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

elife/content-negotiator
========================

eLife Sciences content negotiator

v1.2.1(1y ago)015.8k↓50%[5 PRs](https://github.com/elifesciences/content-negotiator-php/pulls)MITPHPPHP ^7.1 || ^8.0CI passing

Since Nov 14Pushed 3mo ago8 watchersCompare

[ Source](https://github.com/elifesciences/content-negotiator-php)[ Packagist](https://packagist.org/packages/elife/content-negotiator)[ RSS](/packages/elife-content-negotiator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (15)Used By (0)

eLife content negotiator for PHP
================================

[](#elife-content-negotiator-for-php)

[![Build Status](https://camo.githubusercontent.com/f699f0fee29c709a2f7b81388a3da1b83360e57de81198506f4c6deb55daf2e4/68747470733a2f2f616c667265642e656c696665736369656e6365732e6f72672f6275696c645374617475732f69636f6e3f6a6f623d6c6962726172792d636f6e74656e742d6e65676f746961746f722d706870)](https://alfred.elifesciences.org/job/library-content-negotiator-php/)

This library provides a wrapper around [Negotiation](https://github.com/willdurand/Negotiation).

Dependencies
------------

[](#dependencies)

- [Composer](https://getcomposer.org/)
- PHP 7

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

[](#installation)

`composer require elife/content-negotiator`

Set up
------

[](#set-up)

### Silex

[](#silex)

```
use eLife\ContentNegotiator\Silex\ContentNegotiationProvider;
use Negotiation\Accept;

$app->register(new ContentNegotiationProvider());

$app->get('/path', function (Accept $accept) {
    return new Response("Negotiated {$accept->getNormalizedValue()}");
})->before($app['negotiate.accept']('text/plain', 'text/rtf'));
```

When using `symfony/http-kernel` 3.1+, you can type-hint an argument on your controller with one of the following types and the result of the negotiation will be used:

NegotiatorType`$app['negotiate.accept']``Negotiation\Accept``$app['negotiate.accept_charset']``Negotiation\AcceptCharset``$app['negotiate.accept_encoding']``Negotiation\AcceptEncoding``$app['negotiate.accept_language']``Negotiation\AcceptLanguage`Running the tests
-----------------

[](#running-the-tests)

`vendor/bin/phpunit`

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance66

Regular maintenance activity

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 75.5% 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 ~388 days

Recently: every ~46 days

Total

8

Last Release

389d ago

PHP version history (3 changes)v1.0.0PHP ^7.0

v1.1.0PHP ^7.0 || ^8.0

v1.1.1PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/375812?v=4)[Scott Aubrey](/maintainers/scottaubrey)[@scottaubrey](https://github.com/scottaubrey)

---

Top Contributors

[![scottaubrey](https://avatars.githubusercontent.com/u/375812?v=4)](https://github.com/scottaubrey "scottaubrey (40 commits)")[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (6 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (2 commits)")[![lsh-0](https://avatars.githubusercontent.com/u/2142748?v=4)](https://github.com/lsh-0 "lsh-0 (2 commits)")[![NuclearRedeye](https://avatars.githubusercontent.com/u/52923935?v=4)](https://github.com/NuclearRedeye "NuclearRedeye (1 commits)")[![nlisgo](https://avatars.githubusercontent.com/u/383397?v=4)](https://github.com/nlisgo "nlisgo (1 commits)")[![giorgiosironi](https://avatars.githubusercontent.com/u/160299?v=4)](https://github.com/giorgiosironi "giorgiosironi (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/elife-content-negotiator/health.svg)

```
[![Health](https://phpackages.com/badges/elife-content-negotiator/health.svg)](https://phpackages.com/packages/elife-content-negotiator)
```

###  Alternatives

[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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