Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

2 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage

Stable Version Downloads PHP Version License

Warning! This package won't worry about backward compatibily for v0.*.

Service Locator

Yet another service resolver (aka service container) implementation following PSR-11 Container interface.

Installation

$ composer require bauhaus/service-resolver

Using it

<?php

use Bauhaus\ServiceResolverSettings;

$psrContainer = ServiceResolverSettings::new()
    ->withDefintionFiles(
        'path/file-1.php',
        'path/file-2.php',
    )
    ->withServices([
        'service-id-1' => fn () => YourService(), // lazy loaded
        'service-id-2' => new YourService(),
    ])
    ->withDiscoverableNamespaces(
        'App\\Namespace1',
        'App\\Namespace2',
    )
    ->build();

$psrContainer->has($serviceId);
$psrContainer->get($serviceId);

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages