# Container

The Container component is an immutable implementation of Psr\Container\ContainerInterface.

# Creating a container

use Chevere\Container\Container;

$container = new Container();

# Putting services

💡 A service can be of any type.

use Redis;

$service = new Redis();
$id = 'wea';
$container = $container->withPut($id, $service);

# Check if contains service

$contains = $container->has($id); // true if has wea

# Get service

$wea = $container->get($id); // $wea = $service
Last Updated: 10/11/2022, 11:12:32 PM