-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
The second Regex
annotation is ignored by annotation reader, if the line above contains a double quote "
. See the very simplified example:
class
namespace AppBundle\Component;
use Symfony\Component\Validator\Constraints as Assert;
class Foo
{
/**
* @Assert\Regex(pattern="~[a-zA-Z]~")
* "
* @Assert\Regex(pattern="~[<>\\'""*]+~", match=false)
*/
private $foo;
}
reader
$reflectionClass = new \ReflectionClass(\AppBundle\Component\Foo::class);
$property = $reflectionClass->getProperty('foo');
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$annotations = $reader->getPropertyAnnotations($property);
dump($annotations);
expected result
array:2 [▼
0 => Regex^ {#1592 ▼
+message: "This value is not valid."
+pattern: "~[a-zA-Z]~"
+htmlPattern: null
+match: true
+payload: null
}
1 => Regex^ {#1533 ▼
+message: "This value is not valid."
+pattern: "~[<>\\'"*]+~"
+htmlPattern: null
+match: false
+payload: null
}
]
actual result
array:1 [▼
0 => Regex^ {#1592 ▼
+message: "This value is not valid."
+pattern: "~[a-zA-Z]~"
+htmlPattern: null
+match: true
+payload: null
}
]
Metadata
Metadata
Assignees
Labels
No labels