<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bnf / symfony-service-provider-compiler-pass example snippets
$registry = new \Bnf\SymfonyServiceProviderCompilerPass\Registry([
new MyServiceProvide1(),
new MyServiceProvide2()
]);
// during compilation set:
$container->addCompilerPass(new \Bnf\SymfonyServiceProviderCompilerPass\Registry($registry, 'service_provider_registry'));
$container->compile();
$container->set('service_provider_registry', $registry);
$registry = new \Bnf\SymfonyServiceProviderCompilerPass\Registry([
MyServiceProvide1::class,
MyServiceProvide2::class
]);
// during compilation set:
$container->addCompilerPass(new \Bnf\SymfonyServiceProviderCompilerPass\Registry($registry, 'service_provider_registry'));
$container->compile();
$container->set('service_provider_registry', $registry);