Skip to content

Commit

Permalink
Add ServiceProvider.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jul 17, 2024
1 parent 3775e9e commit 720fa31
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Service/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Ghostwriter\Arm\Service;

use Ghostwriter\Arm\Configuration;
use Ghostwriter\Arm\Console\Application;
use Ghostwriter\Arm\Interface\WorkspaceInterface;
use Ghostwriter\Arm\Service\Factory\ApplicationFactory;
use Ghostwriter\Arm\Service\Factory\ConfigurationFactory;
use Ghostwriter\Arm\Service\Factory\WorkspaceFactory;
use Ghostwriter\Arm\Workspace;
use Ghostwriter\Container\Interface\ContainerInterface;
use Ghostwriter\Container\Interface\ServiceProviderInterface;
use Override;
use Throwable;

final readonly class ServiceProvider implements ServiceProviderInterface
{
/**
* @throws Throwable
*/
#[Override]
public function __invoke(ContainerInterface $container): void
{
$container->alias(Workspace::class, WorkspaceInterface::class);
$container->factory(WorkspaceInterface::class, WorkspaceFactory::class);
$container->factory(Application::class, ApplicationFactory::class);
$container->factory(Configuration::class, ConfigurationFactory::class);
}
}

0 comments on commit 720fa31

Please sign in to comment.