Set up defintion interface and a logger definition.

This commit is contained in:
Dave Smith-Hayes 2025-06-19 08:31:30 -04:00
parent 13aa57512d
commit 5389b59c20
3 changed files with 19 additions and 17 deletions

View File

@ -0,0 +1,16 @@
<?php
namespace Slovocast\Infrastructure\Application;
/**
* Ideally this would define the Container definition required for setting up
* dependencies within the PHP DI ContainerBuilder class
*/
interface DefinitionInterface
{
/**
* @return array<string, mixed> The definition structure used for setting
* up a Container
*/
public function define(): array;
}

View File

@ -7,11 +7,11 @@ use Psr\Log\LoggerInterface;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Level; use Monolog\Level;
use Monolog\Logger; use Monolog\Logger;
use Slovocast\Infrastructure\Application\SetupInterface; use Slovocast\Infrastructure\Application\DefinitionInterface;
class LoggerSetup implements SetupInterface class LoggerDefinition implements DefinitionInterface
{ {
public function setup(): array public function define(): array
{ {
return [ return [
LoggerInterface::class => function (ContainerInterface $c) { LoggerInterface::class => function (ContainerInterface $c) {

View File

@ -1,14 +0,0 @@
<?php
namespace Slovocast\Infrastructure\Application;
use Psr\Container\ContainerInterface as Container;
interface SetupInterface
{
/**
* @param Container $container
* @return array<string, callable> A function that instantiates the class
*/
public function setup(): array;
}