PHP code example of thecodingmachine / service-provider-bridge-bundle

1. Go to this page and download the library: Download thecodingmachine/service-provider-bridge-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thecodingmachine / service-provider-bridge-bundle example snippets


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

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

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

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

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