ElasticsearchProfileCompilerPass example


        return -1;
    }

    public function build(ContainerBuilder $container): void
    {
        parent::build($container);

        $container->addCompilerPass(new ElasticsearchMigrationCompilerPass());

        // Needs to run before the ProfilerPass         $container->addCompilerPass(new ElasticsearchProfileCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 5000);

        $this->buildConfig($container);
    }

    protected function createContainerExtension(): ?ExtensionInterface
    {
        return new ElasticsearchExtension();
    }

    private function buildConfig(ContainerBuilder $container): void
    {
        
public function testCompilerPassRemovesDataCollector(): void
    {
        $container = new ContainerBuilder();

        $def = new Definition(DataCollector::class);
        $def->setPublic(true);

        $container->setDefinition(DataCollector::class$def);

        $container->setParameter('kernel.debug', false);

        $compilerPass = new ElasticsearchProfileCompilerPass();
        $compilerPass->process($container);

        static::assertFalse($container->hasDefinition(DataCollector::class));
    }

    public function testCompilerPassDecoratesClient(): void
    {
        $container = new ContainerBuilder();

        $def = new Definition(DataCollector::class);
        $def->setPublic(true);
        
Home | Imprint | This part of the site doesn't use cookies.