Set up defintion interface and a logger definition.
This commit is contained in:
parent
13aa57512d
commit
5389b59c20
16
app/src/Infrastructure/Application/DefinitionInterface.php
Normal file
16
app/src/Infrastructure/Application/DefinitionInterface.php
Normal 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;
|
||||||
|
}
|
@ -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) {
|
@ -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;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user