PHPackages                             alterway/rest-problem-bundle - 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. [API Development](/categories/api)
4. /
5. alterway/rest-problem-bundle

ActiveSymfony-bundle[API Development](/categories/api)

alterway/rest-problem-bundle
============================

way to respect Problem Details for HTTP APIs RFC (http://tools.ietf.org/html/draft-nottingham-http-problem-03)

v0.0.1(12y ago)56337MITPHPPHP &gt;=5.3.3

Since Oct 30Pushed 11y ago12 watchersCompare

[ Source](https://github.com/alterway/RestProblemBundle)[ Packagist](https://packagist.org/packages/alterway/rest-problem-bundle)[ RSS](/packages/alterway-rest-problem-bundle/feed)WikiDiscussions master Synced 2mo ago

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

\# RestProblemBundle

Bundle to manage Problems in API with Symfony2.

[![Build Status](https://camo.githubusercontent.com/d9309dd03bb6faab0043bdeb62c9b1f71dd243c2168890bcf6d60c20bc97eb74/68747470733a2f2f7472617669732d63692e6f72672f616c7465727761792f5265737450726f626c656d42756e646c652e706e67)](https://travis-ci.org/alterway/RestProblemBundle)

This bundle follows the [Problem Details for HTTP APIs](http://tools.ietf.org/html/draft-nottingham-http-problem-03)recommandation.

\## Installation

Edit your `composer.json`:

```
"require": {
    "alterway/rest-problem-bundle" : "master"
}
```

And run Composer:

```
php composer.phar update alterway/rest-problem-bundle

```

Enable your bundle in your `AppKernel.php`:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Alterway\Bundle\RestProblemBundle\AwRestProblemBundle(),
    );
}
```

Usage
-----

[](#usage)

```
use Alterway\Bundle\RestProblemBundle\Response\ProblemResponse;
use Alterway\Bundle\RestProblemBundle\Problem;

public function demoAction(Request $request)
{

    $form = // (...)

    $form->bind($request);
    if (!$form->isValid()) {
        $problem = new Problem\InvalidQueryForm($form);
        return new ProblemResponse($problem, 403);
    }
}
```

\## Usage with annotations

Remember to enable annotations :

```
sensio_framework_extra:
router:  { annotations: true }
request: { converters: true }
view:    { annotations: true }
cache:   { annotations: true }
```

And to register the autoloader in your `app/autoload.php` file:

```
Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
```

This will send an `application/api-problem+json` header:

```
use Alterway\Bundle\RestProblemBundle\Response\ProblemResponse;
use Alterway\Bundle\RestProblemBundle\Controller\Annotations\Problem;

/**
* @Problem
*/
public function demoAction(Request $request)
{

    $form = // (...)

    $form->bind($request);
    if (!$form->isValid()) {
        return new Problem\InvalidQueryForm($form);
    }
}
```

Problem's types
---------------

[](#problems-types)

You need to create your own problem types. There are by default the following problems:

- Problem\\InvalidQuery
- Problem\\InvalidQueryForm
- ...

Todo
----

[](#todo)

Add controllers and route to provide `problemType`

\## Contribute

Install dev dependencies:

```
php composer.phar update --dev

```

Run Behat:

```
./vendor/bin/behat @AwRestProblemBundle

```

Copyright
---------

[](#copyright)

Copyright (c) 2013 La Ruche Qui Dit Oui!. See LICENSE for details.

Contributors
------------

[](#contributors)

- Lead: Jean-François Lépine (Halleck45)
- Developer: Antoine Lévêque (gh0stonio)

Sponsors
--------

[](#sponsors)

- [Alter Way](http://www.alterway.fr)
- [La Ruche Qui Dit Oui!](http://www.laruchequiditoui.fr)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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

4574d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/919c0dd2d4755f6195d031c004340879606dfe43946fef8758edf5161271728e?d=identicon)[herveleclerc](/maintainers/herveleclerc)

---

Top Contributors

[![kimlai](https://avatars.githubusercontent.com/u/1673880?v=4)](https://github.com/kimlai "kimlai (5 commits)")[![gh0stonio](https://avatars.githubusercontent.com/u/1764557?v=4)](https://github.com/gh0stonio "gh0stonio (3 commits)")[![marijn](https://avatars.githubusercontent.com/u/65233?v=4)](https://github.com/marijn "marijn (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alterway-rest-problem-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alterway-rest-problem-bundle/health.svg)](https://phpackages.com/packages/alterway-rest-problem-bundle)
```

PHPackages © 2026

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