ResolveNoPreloadPass example

new RemoveUnusedDefinitionsPass(),
            new AnalyzeServiceReferencesPass(),
            new CheckExceptionOnInvalidReferenceBehaviorPass(),
            new InlineServiceDefinitionsPass(new AnalyzeServiceReferencesPass()),
            new AnalyzeServiceReferencesPass(),
            new DefinitionErrorExceptionPass(),
        ]];

        $this->afterRemovingPasses = [
            0 => [
                new ResolveHotPathPass(),
                new ResolveNoPreloadPass(),
                new AliasDeprecatedPublicServicesPass(),
            ],
            // Let build parameters be available as late as possible             -2048 => [new RemoveBuildParametersPass()],
        ];
    }

    /** * Returns all passes in order to be processed. * * @return CompilerPassInterface[] */
$container->register('not_preloaded')
            ->setPublic(true)
            ->addTag('container.no_preload')
            ->addArgument(new Reference('not_preloaded_dep'))
            ->addArgument(new Reference('common_dep'));

        $container->register('preloaded_dep');
        $container->register('not_preloaded_dep');
        $container->register('common_dep');

        (new ResolveNoPreloadPass())->process($container);

        $this->assertFalse($container->getDefinition('entry_point')->hasTag('container.no_preload'));
        $this->assertFalse($container->getDefinition('preloaded')->hasTag('container.no_preload'));
        $this->assertFalse($container->getDefinition('preloaded_dep')->hasTag('container.no_preload'));
        $this->assertFalse($container->getDefinition('common_dep')->hasTag('container.no_preload'));
        $this->assertTrue($container->getDefinition('not_preloaded')->hasTag('container.no_preload'));
        $this->assertTrue($container->getDefinition('not_preloaded_dep')->hasTag('container.no_preload'));
    }
}
new RemoveUnusedDefinitionsPass(),
            new AnalyzeServiceReferencesPass(),
            new CheckExceptionOnInvalidReferenceBehaviorPass(),
            new InlineServiceDefinitionsPass(new AnalyzeServiceReferencesPass()),
            new AnalyzeServiceReferencesPass(),
            new DefinitionErrorExceptionPass(),
        ]];

        $this->afterRemovingPasses = [
            0 => [
                new ResolveHotPathPass(),
                new ResolveNoPreloadPass(),
                new AliasDeprecatedPublicServicesPass(),
            ],
            // Let build parameters be available as late as possible             -2048 => [new RemoveBuildParametersPass()],
        ];
    }

    /** * Returns all passes in order to be processed. * * @return CompilerPassInterface[] */
Home | Imprint | This part of the site doesn't use cookies.