TaskServiceProvider.php
- Pfad:
src/ServiceProvider/TaskServiceProvider.php - Namespace: ServiceProvider
- Zeilen: 39 | Größe: 1,819 Bytes
- Geändert: 2025-12-25 16:57:33 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 90
- Dependencies: 60 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Dependencies 10
- implements ServiceProvider\ServiceProviderInterface
- use Domain\Repository\TaskAssignmentRepositoryInterface
- use Domain\Repository\TaskCommentRepositoryInterface
- use Domain\Repository\TaskRepositoryInterface
- use Domain\Repository\TaskResultRepositoryInterface
- use Framework\Container
- use Infrastructure\Persistence\TaskAssignmentRepository
- use Infrastructure\Persistence\TaskCommentRepository
- use Infrastructure\Persistence\TaskRepository
- use Infrastructure\Persistence\TaskResultRepository
Klassen 12
-
TaskServiceProviderclass Zeile 22 -
Containerclass Zeile 27 -
Containerclass Zeile 28 -
Containerclass Zeile 29 -
Containerclass Zeile 30 -
Containerclass Zeile 33 -
setclass Zeile 33 -
Containerclass Zeile 34 -
setclass Zeile 34 -
Containerclass Zeile 35 -
setclass Zeile 35 -
Containerclass Zeile 36
Funktionen 1
-
register()public Zeile 24
Verwendet von 1
- services.php use
Code
<?php
declare(strict_types=1);
// @responsibility: Register Task bounded context services in DI container
namespace ServiceProvider;
use Domain\Repository\TaskAssignmentRepositoryInterface;
use Domain\Repository\TaskCommentRepositoryInterface;
use Domain\Repository\TaskRepositoryInterface;
use Domain\Repository\TaskResultRepositoryInterface;
use Framework\Container;
use Infrastructure\Persistence\TaskAssignmentRepository;
use Infrastructure\Persistence\TaskCommentRepository;
use Infrastructure\Persistence\TaskRepository;
use Infrastructure\Persistence\TaskResultRepository;
/**
* TaskServiceProvider registers all task management services.
*/
final class TaskServiceProvider implements ServiceProviderInterface
{
public function register(Container $container): void
{
// Repositories
$container->set(TaskRepository::class, fn (Container $c) => new TaskRepository($c->get('pdo.dev')));
$container->set(TaskAssignmentRepository::class, fn (Container $c) => new TaskAssignmentRepository($c->get('pdo.dev')));
$container->set(TaskResultRepository::class, fn (Container $c) => new TaskResultRepository($c->get('pdo.dev')));
$container->set(TaskCommentRepository::class, fn (Container $c) => new TaskCommentRepository($c->get('pdo.dev')));
// Interface aliases
$container->set(TaskRepositoryInterface::class, fn (Container $c) => $c->get(TaskRepository::class));
$container->set(TaskResultRepositoryInterface::class, fn (Container $c) => $c->get(TaskResultRepository::class));
$container->set(TaskAssignmentRepositoryInterface::class, fn (Container $c) => $c->get(TaskAssignmentRepository::class));
$container->set(TaskCommentRepositoryInterface::class, fn (Container $c) => $c->get(TaskCommentRepository::class));
}
}