admin管理员组

文章数量:1347691

Created a class CorrespondenceLanguageValidator which extends Symfony\Component\Validator\ConstraintValidator

Then I tried to import a class to this validator class using dependency injection using

public function __construct(private ClubService $clubService)
{

}

but always getting the error

Too few arguments to function Fsa\ApiV2Bundle\Validator\ContactField\Constraints\CorrespondenceLanguageValidator::__construct(), 0 passed in /var/www/html/fg-internal-api/vendor/symfony/validator/ConstraintValidatorFactory.php on line 40 and exactly 1 expected

本文标签: Autowiring services failed in PHP Symfony ConstraintValidatorStack Overflow