user = $user; return; } $this->user = new User(); $this->user->setSource($this->sourceRepository->findOneBySlug(GuestUserFixtureSource::getSlug())); } /** * @param SourceRepositoryInterface $sourceRepository * @param UserInterface $user */ public function __construct(SourceRepositoryInterface $sourceRepository, ?UserInterface $user) { $this->sourceRepository = $sourceRepository; $this->setUser($user); } /** * {@inheritdoc} * * @see \App\Domain\UserManagement\UserSourceDirectorInterface::getUser() */ public function getUser(): UserInterface { return $this->user; } }