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

AbandonedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

spiechu/symfony-commons-bundle
==============================

My handy toolkit for Symfony.

0.3(8y ago)748MITPHPPHP &gt;=7.1

Since Aug 20Pushed 6y agoCompare

[ Source](https://github.com/spiechu/symfony-commons-bundle)[ Packagist](https://packagist.org/packages/spiechu/symfony-commons-bundle)[ Docs](https://github.com/spiechu/symfony-commons-bundle)[ RSS](/packages/spiechu-symfony-commons-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (12)Versions (9)Used By (0)

Symfony Commons Bundle
======================

[](#symfony-commons-bundle)

TravisCIStyleCIScrutinizerCode Coverage[![Build Status](https://camo.githubusercontent.com/a65f54a64f8a11531154c7d8b3596221e6c255fb1cb1a00002c609610d5b9605/68747470733a2f2f7472617669732d63692e6f72672f737069656368752f73796d666f6e792d636f6d6d6f6e732d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/spiechu/symfony-commons-bundle)[![StyleCI](https://camo.githubusercontent.com/f9dcf4c9d73da521a3ba5730cde7ecb1ac16ce4d60812052c4d7c690c37e92c6/68747470733a2f2f7374796c6563692e696f2f7265706f732f39393531333434342f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/99513444)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/931bb91b413d6343d45f5cefc07407debb0a9be03c0eff66562c38ff66c49564/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737069656368752f73796d666f6e792d636f6d6d6f6e732d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/spiechu/symfony-commons-bundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/9a449acfd158aba4d7619f2371358ed77f70eed6638cb50a9faa1004359d885f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737069656368752f73796d666f6e792d636f6d6d6f6e732d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/spiechu/symfony-commons-bundle/?branch=master)Intro
-----

[](#intro)

Main purpose of this bundle is to introduce some "missing" functionalities to Symfony Framework.

Consider this bundle as part of my preparations for Symfony Certification. I can only learn by doing instead of passive DOC reading.

Bundle characteristics:

- plays well with [FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle)
- [Symfony Flex ready](https://github.com/symfony/recipes-contrib/tree/master/spiechu/symfony-commons-bundle)

Bundle rules
------------

[](#bundle-rules)

1. Every feature is disabled by default. You only enable what you need.
2. No event listeners hanging around when unneeded.
3. Provide sane defaults and extensive customisation possibilities.

Features
--------

[](#features)

### GET method override

[](#get-method-override)

Enabling this feature will allow you to use URLs like `http://myapp.com/mypath?_method=DELETE` or `PUT` to override HTTP GET request method.

Sometimes you might need such functionality for example in admin area to ban / delete users. You can expose simple links and still have clean PUT / DELETE controller actions.

Full [documentation here](src/Resources/doc/get_method_override.md).

### Response schema validation

[](#response-schema-validation)

Response schema validation allows you to validate endpoint responses on-the-fly. You just need to annotate controller action with `@ResponseSchemaValidator` annotation.

Typical use case is:

```
// src/AppBundle/Controller/AdminController.php

use Spiechu\SymfonyCommonsBundle\Annotation\Controller\ResponseSchemaValidator;

class AdminController extends Controller
{
    /**
     * @Route("/", name="my_route")
     *
     * @ResponseSchemaValidator(
     *  json={
     *   200="@AppBundle/Resources/response_schema/my_route_200.json",
     *   500="@AppBundle/Resources/response_schema/my_route_500.json"
     *  }
     * )
     */
    public function indexAction(): Response
    {
        // ...
    }
}
```

Full [documentation here](src/Resources/doc/response_schema_validation.md).

### API versioning

[](#api-versioning)

When you have multiple API versions it's usually done by extending Controllers. This bundle introduces handy `@ApiVersion` annotation. You need to annotate your controller classes with this custom annotation and set version like:

```
// src/AppBundle/Controller/V1_0/UserController.php

use Spiechu\SymfonyCommonsBundle\Annotation\Controller\ApiVersion;

/**
 * @ApiVersion("1.0")
 */
class UserController extends Controller
{
    /**
     * @Route("/", name="my_route")
     */
    public function indexAction(): Response
    {
        // ...
    }
}
```

Then in extending class:

```
// src/AppBundle/Controller/V1_1/UserController.php

use Spiechu\SymfonyCommonsBundle\Annotation\Controller\ApiVersion;
use Spiechu\SymfonyCommonsBundle\Controller\V1_0\UserController as BaseUserController;

/**
 * @ApiVersion("1.1")
 */
class UserController extends BaseUserController
{
    /**
     * @Route("/", name="my_route")
     */
    public function indexAction(): Response
    {
        // ...
    }
}
```

From now on you can inject `Spiechu\SymfonyCommonsBundle\Service\ApiVersionProvider` service to your services and check what is the current request API version.

Full [documentation here](src/Resources/doc/api_versioning.md).

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

[](#installation)

I'm assuming you have Composer installed globally.

### Flex based installation (Symfony 3.4 and 4)

[](#flex-based-installation-symfony-34-and-4)

#### Download &amp; enable the Bundle

[](#download--enable-the-bundle)

Run console command in Symfony project directory:

```
composer req spiechu/symfony-commons-bundle
```

#### Enable some/all Bundle features

[](#enable-someall-bundle-features)

```
# config/packages/spiechu_symfony_commons.yml

spiechu_symfony_commons:
    get_method_override:
        enabled: true
    response_schema_validation:
        enabled: true
    api_versioning:
        enabled: true
```

### Composer based installation (Symfony 3.4)

[](#composer-based-installation-symfony-34)

#### Download the Bundle

[](#download-the-bundle)

Run console command in Symfony project directory:

```
composer require spiechu/symfony-commons-bundle
```

#### Enable the Bundle

[](#enable-the-bundle)

Enable the bundle by adding the following line in the `app/AppKernel.php` file of your project:

```
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Spiechu\SymfonyCommonsBundle\SpiechuSymfonyCommonsBundle(),
        ];

        // ...
    }
}
```

#### Enable some/all Bundle features

[](#enable-someall-bundle-features-1)

Preferred way of configuring Bundle is via YAML config:

```
# app/config/config.yml

spiechu_symfony_commons:
    get_method_override:
        enabled: true
    response_schema_validation:
        enabled: true
    api_versioning:
        enabled: true
```

Configuration
-------------

[](#configuration)

Configuration reference [can be found here](src/Resources/doc/configuration_reference.md).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.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

Every ~22 days

Total

8

Last Release

3030d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58c6df1bd2da02cf227abcf02e660b920eab7288a930b98c8ebdfc5fb9fdcf81?d=identicon)[spiechu](/maintainers/spiechu)

---

Top Contributors

[![spiechu](https://avatars.githubusercontent.com/u/673912?v=4)](https://github.com/spiechu "spiechu (276 commits)")[![emulienfou](https://avatars.githubusercontent.com/u/84061?v=4)](https://github.com/emulienfou "emulienfou (1 commits)")

---

Tags

api-versioningschema-validationsymfonysymfony-bundlesymfonybundleapi versioningschema validationrequest overriding

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spiechu-symfony-commons-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/spiechu-symfony-commons-bundle/health.svg)](https://phpackages.com/packages/spiechu-symfony-commons-bundle)
```

###  Alternatives

[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[ekreative/uuid-extra-bundle

Paramconverter, Normalizer and Form Type for Ramsey Uuid

18168.6k](/packages/ekreative-uuid-extra-bundle)[fsi/datagrid-bundle

FSi Datagrid Bundle

1859.8k1](/packages/fsi-datagrid-bundle)

PHPackages © 2026

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