Skip to content

Conversation

@jderusse
Copy link
Member

Q A
Branch? master
Bug fix? yes
New feature? no
Deprecations? no
Tickets NA
License MIT
Doc PR NA

When using the new on an entity ExpressionLanguageSyntax (basicaly copy/pasted the sample from https://symfony.com/blog/new-in-symfony-5-1-expressionlanguage-validator), I face a first error:

Constraint validator "" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "Symfony\Component\Validator\Constraints\ExpressionLanguageSyntax".

indeed, the service is need to generate a valide alias

Which looks weird for a Constraint

This PR makes the ExpressionLanguage dependency optionnal in ExpressionLanguageSyntaxValidator, and removes the service than is not needed anyore

@jderusse
Copy link
Member Author

ping @Andrej-in-ua

}
}

private function getExpressionLanguage(): ExpressionLanguage
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inspired from

private function getExpressionLanguage(): ExpressionLanguage
{
if (null === $this->expressionLanguage) {
$this->expressionLanguage = new ExpressionLanguage();
}
return $this->expressionLanguage;
}

@xabbuh xabbuh added this to the 5.1 milestone May 21, 2020
@fabpot fabpot changed the base branch from master to 5.1 May 22, 2020 17:13
@fabpot
Copy link
Member

fabpot commented May 22, 2020

Thank you @jderusse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants