prooph / proophessor-do-symfony

Symfony version of proophessor-do CQRS + Event Sourcing example app
http://getprooph.org/
Other
170 stars 52 forks source link

Cannot autowire service "Prooph\ProophessorDo\Model\User\Service\ChecksUniqueUsersEmailAddress" #36

Closed bassim closed 5 years ago

bassim commented 5 years ago

(1/1) RuntimeException Cannot autowire service "Prooph\ProophessorDo\Model\User\Service\ChecksUniqueUsersEmailAddress": argument "$userFinder" of method "Prooph\ProophessorDo\Infrastructure\Service\ChecksUniqueUsersEmailAddressFromReadModel::__construct()" references class "Prooph\ProophessorDo\Projection\User\UserFinder" but no such service exists. You should maybe alias this class to the existing "proophdo.todo_projection.user_finder" service.

codeliner commented 5 years ago

Can you provide a PR to fix the problem?

dgreda commented 5 years ago

I'm experiencing the same problem. Additionally I also had problem with swiftmailer, which I temporarily overcome by removing it from requirements, it was the following issue: Unrecognized option "url" under "swiftmailer.mailers.default" It somehow seems to me, as if the commited composer.lock is locked to versions of dependencies that your example app is not working with / is not compatible with.

dave-redfern commented 5 years ago

I believe the swiftmailer issue is due to the version in composer.json. For SF 4+ it should be >=3.1 to work properly; though it does appear that the composer.lock file is not consistent (e.g. installs old version of flex that is not compatible with changes in composer 1.7+). Changing swiftmailer-bundle to "symfony/swiftmailer-bundle": "^3.1", and then composer update, together with the corrections to the services.yaml suggested in PR #37 should get things working.

codeliner commented 5 years ago

Had to delete all dependencies and reinstall due to this exception:

[ErrorException]                                                                                                                                                                                           
  Declaration of Symfony\Flex\ParallelDownloader::getRemoteContents($originUrl, $fileUrl, $context) should be compatible with Composer\Util\RemoteFilesystem::getRemoteContents($originUrl, $fileUrl, $cont  
  ext, ?array &$responseHeaders = NULL) 

Dependency update can be found in #38 @bassim @dave-redfern can you please verify that the problem is finally solved with the PR?

dave-redfern commented 5 years ago

@codeliner confirmed #38 fixes the dependencies.

I verified by: reverting any modified files, deleting var and vendor folders and then running composer install. It completed without errors.