PHPackages                             thecodingmachine/service-provider-bridge-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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. thecodingmachine/service-provider-bridge-bundle

ActiveSymfony-bundle[PSR &amp; Standards](/categories/psr-standards)

thecodingmachine/service-provider-bridge-bundle
===============================================

This Symfony Bundle allows Symfony applications to use service providers as defined in container-interop/service-provider

v0.4.1(8y ago)44.8k5[1 PRs](https://github.com/thecodingmachine/service-provider-bridge-bundle/pulls)1MITPHPPHP &gt;=7.1.0

Since Feb 27Pushed 5y ago4 watchersCompare

[ Source](https://github.com/thecodingmachine/service-provider-bridge-bundle)[ Packagist](https://packagist.org/packages/thecodingmachine/service-provider-bridge-bundle)[ RSS](/packages/thecodingmachine-service-provider-bridge-bundle/feed)WikiDiscussions 1.0 Synced 3w ago

READMEChangelog (5)Dependencies (8)Versions (9)Used By (1)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8e85cdbabecb5b305935eb581ab4639ad71012eb98170997e4ebe9e64ea101dd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865636f64696e676d616368696e652f736572766963652d70726f76696465722d6272696467652d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d312e30)](https://scrutinizer-ci.com/g/thecodingmachine/service-provider-bridge-bundle/?branch=1.0)[![Build Status](https://camo.githubusercontent.com/0ddc0a7f5a2041dee746fc65ba0aaa9774db2b9a9d7e09a2fd91c7acc69b47c5/68747470733a2f2f7472617669732d63692e6f72672f746865636f64696e676d616368696e652f736572766963652d70726f76696465722d6272696467652d62756e646c652e7376673f6272616e63683d312e30)](https://travis-ci.org/thecodingmachine/service-provider-bridge-bundle)[![Coverage Status](https://camo.githubusercontent.com/2b4d0a8387702043069409502c98a286ffbd8e18f49d444e2f7ad182d98fa8c1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746865636f64696e676d616368696e652f736572766963652d70726f76696465722d6272696467652d62756e646c652f62616467652e7376673f6272616e63683d312e3026736572766963653d676974687562)](https://coveralls.io/github/thecodingmachine/service-provider-bridge-bundle?branch=1.0)

container-interop/service-provider bridge bundle
================================================

[](#container-interopservice-provider-bridge-bundle)

Import `service-provider` as defined in `container-interop` into a Symfony application.

Usage
-----

[](#usage)

### Installation

[](#installation)

Add `TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle` in your kernel (the `app/AppKernel.php` file).

**AppKernel.php**

```
    public function registerBundles()
    {
        $bundles = [
            ...
            new \TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle()
        ];
        ...
    }
```

### Usage using thecodingmachine/discovery

[](#usage-using-thecodingmachinediscovery)

The bridge bundle will use thecodingmachine/discvoery to automatically discover the service providers of your project. If the service provider you are loading publishes itself on Discovery, then you are done. The services declared in the service provider are available in the Symfony container!

### Usage using manual declaration

[](#usage-using-manual-declaration)

If the service provider you are using does not publishes itself using thecodingmachine/discovery, you will have to declare it manually in the constructor of the bundle.

**AppKernel.php**

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            ...
            new \TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle([
                new MyServiceProvide1(),
                new MyServiceProvide2()
            ])
        ];
        ...
    }
}
```

Alternatively, you can also pass the service provider class name. This is interesting because the service-locator bundle will not instantiate the service provider unless it is needed for a service. You can therefore improve performances of your application.

**AppKernel.php**

```
    public function registerBundles()
    {
        $bundles = [
            ...
            new \Puli\SymfonyBundle\PuliBundle(),
            new \TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle([
                MyServiceProvide1::class,
                MyServiceProvide2::class
            ])
        ];
        ...
    }
```

Finally, if you need to pass parameters to the constructors of the service providers, you can do this by passing an array:

**AppKernel.php**

```
    public function registerBundles()
    {
        $bundles = [
            ...
            new \Puli\SymfonyBundle\PuliBundle(),
            new \TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle([
                [ MyServiceProvide1::class, [ "param1", "param2" ] ],
                [ MyServiceProvide2::class, [ 42 ] ],
            ])
        ];
        ...
    }
```

Disabling thecodingmachine/discovery
------------------------------------

[](#disabling-thecodingmachinediscovery)

You can disable Discovery by passing `false` as the second argument of the bundle:

**AppKernel.php**

```
    public function registerBundles()
    {
        $bundles = [
            ...
            // false is passed as second argument. Puli discovery will be disabled.
            new \TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle([
                ...
            ], false)
        ];
        ...
    }
```

Default aliases
---------------

[](#default-aliases)

By default, this package provides a `CommonAliasesServiceProvider` that will create the following aliases:

- `logger` =&gt; `Psr\Log\LoggerInterface`
- `cache.app` =&gt; `Psr\Cache\CacheItemPoolInterface`
- `twig` =&gt; `Twig_Environment`

This is useful because most service providers expect entries to be available by class/interface name.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.1% 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 ~188 days

Recently: every ~234 days

Total

9

Last Release

2267d ago

Major Versions

0.3.x-dev → 1.0.x-dev2020-04-14

PHP version history (2 changes)v0.1.0PHP &gt;=5.5.0

v0.4.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (37 commits)")[![romm](https://avatars.githubusercontent.com/u/6342901?v=4)](https://github.com/romm "romm (5 commits)")

---

Tags

symfonycontainer-interopPSR-11service provider

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thecodingmachine-service-provider-bridge-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/thecodingmachine-service-provider-bridge-bundle/health.svg)](https://phpackages.com/packages/thecodingmachine-service-provider-bridge-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M377](/packages/easycorp-easyadmin-bundle)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k2](/packages/web-auth-webauthn-framework)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

65474.5k9](/packages/web-auth-webauthn-symfony-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[ecotone/symfony-bundle

Ecotone for Symfony — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Symfony Messenger, via PHP attributes.

11241.1k1](/packages/ecotone-symfony-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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