Skip to content

Conversation

@voronkovich
Copy link
Contributor

@voronkovich voronkovich commented Mar 6, 2025

Summary of Changes

This PR introduces a new container method def() which returns a special resource builder allowing to configure service in a more convenient way using fluent interface:

$container->def(CacheControllerFactoryInterface::class)
    ->shared()
    ->protected()
    ->lazy(CacheControllerFactory::class)
    ->factory(
        function (Container $container) {
            return new CacheControllerFactory();
        },
    )
    ->aliases([ 'cache.controller.factory', CacheControllerFactory::class ])
    ->tags([ 'cache_controller' ])
    ->end();

Testing Instructions

Unit tests provided

Documentation Changes Required

Yes

@voronkovich voronkovich changed the title Define services in more convenient and readable way [3.x] Define services in more convenient and readable way Mar 13, 2025
@voronkovich voronkovich force-pushed the service-definition branch 3 times, most recently from a18b519 to 473a3b7 Compare May 9, 2025 14:35
@voronkovich voronkovich force-pushed the service-definition branch from 473a3b7 to 82655d1 Compare May 9, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant