RFC
Instead of using:
ExampleHandler.php:
public function handle(ServerRequestInterface $request): ResponseInterface
{
$entity = $handler->exampleService->findOneBy($params);
// ...
}
ExampleService.php:
public function findOneBy(array $params): Example
{
return $this->exampleRepository->findOneBy($params);
}
we should use:
ExampleHandler.php:
public function handle(ServerRequestInterface $request): ResponseInterface
{
$entity = $handler->exampleService->getExampleRepository()->findOneBy($params);
// ...
}
This way we would simplify a lot the existing services and could drop tons of service methods that have a single purpose of receiving request params from the handler and returning the data provided by the repository.
RFC
Instead of using:
ExampleHandler.php:ExampleService.php:we should use:
ExampleHandler.php:This way we would simplify a lot the existing services and could drop tons of service methods that have a single purpose of receiving request params from the handler and returning the data provided by the repository.