So, I'm trying to set up php-di for the first time, but I'm having some trouble with the builder. I keep getting the error:
Uncaught exception 'DI\NotFoundException' with message 'No entry or class found for 'IConnection'' in /path/PHPDiContainer.php'
Where am I going wrong in my container setup?
<?php
require_once 'vendor/autoload.php';
use repositories\Connection;
use irepositories\IConnection;
use DI\ContainerBuilder;
$container = DI\ContainerBuilder::buildDevContainer();
$builder = new DI\containerBuilder();
$builder->addDefinitions([
IConnection::class => DI\object(Connection::class)
]);
$container = $builder->build();
$connection = $container->get('Connection');
... Code to show it works.
?>