symfony-docs icon indicating copy to clipboard operation
symfony-docs copied to clipboard

Validation reference misses `exactly` option in documentation

Open mvhirsch opened this issue 3 years ago • 2 comments

Hi,

just noticed that the documentation lacks the option exactly in Assert\Length constraint: https://symfony.com/doc/current/reference/constraints/Length.html

Looks like exactMessage is documented since Symfony 2.3, but there is no sign of exactly and what it does (saving my life today, for example ;-)).

mvhirsch avatar Jul 25 '22 08:07 mvhirsch

I honestly do not know why this was introduced in symfony/symfony#38499. Maybe @derrabus remembers.

xabbuh avatar Jul 30 '22 19:07 xabbuh

Because that's how the annotation @Length(42) has always behaved, as you can see in the code that was executed prior to my change:

} elseif (\is_array($options) && isset($options['value']) && !isset($options['min']) && !isset($options['max'])) {
    $options['min'] = $options['max'] = $options['value'];
    unset($options['value']);
}

My change introduced a named argument all right, but it didn't introduce functionality that wasn't already there.

derrabus avatar Jul 30 '22 19:07 derrabus