CodelyTV / php-ddd-example

🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 7
https://pro.codely.tv/library/ddd-en-php
2.98k stars 1.08k forks source link

ERROR ON FIRST RUN http://localhost:8041/health-check #215

Closed trio1234 closed 3 years ago

trio1234 commented 3 years ago

When i run first time docker-compose up i cant access to

http://localhost:8041/health-check or http://localhost:8041

ERROR Cannot autowire service "CodelyTv\Apps\Backoffice\Frontend\Controller\Courses\CoursesGetWebController": argument "$session" of method "CodelyTv\Shared\Infrastructure\Symfony\WebController::__construct()" references class "Symfony\Component\HttpFoundation\Session\Session" but no such service exists. Try changing the type-hint to "Symfony\Component\HttpFoundation\Session\SessionInterface" instead.

trio1234 commented 3 years ago

FIX

Change src/Shared/Infrastructure/Symfony/WebController.php

use Symfony\Component\HttpFoundation\Session\Session;
for 
use Symfony\Component\HttpFoundation\Session\SessionInterface;

Same as CodelyTv\Shared\Infrastructure\Symfony\FlashSession;