browscap / BrowscapBundle

Symfony2 Bundle to access the browscap information
13 stars 12 forks source link

Service issues with Symfony 4.1 #25

Open soullivaneuh opened 6 years ago

soullivaneuh commented 6 years ago

The console update command need a service registration and the borwscap service need to be public or autowired (#24)

Current workaround on kernel compilation:

final class Kernel extends BaseKernel implements CompilerPassInterface
{
    use MicroKernelTrait;

    public function process(ContainerBuilder $container): void
    {
        $container->setDefinition(
            \Browscap\BrowscapBundle\Command\UpdateCommand::class,
            (new Definition(\Browscap\BrowscapBundle\Command\UpdateCommand::class))
                ->addTag('console.command')
        );
        $container->getDefinition('browscap')->setPublic(true);
    }
mimmi20 commented 6 years ago

@Soullivaneuh Please provide a PR for this.