ViolationPath::getElements()

array getElements() Returns the elements of the property path as array. Return Value array An array of property/index names

ViolationPath::getElement()

string getElement(int $index) Returns the element at the given index in the property path. Parameters int $index The index key Return Value string A property or index name Exceptions OutOfBoundsException If the offset is invalid

ViolationPath::getLength()

int getLength() Returns the length of the property path, i.e. the number of elements. Return Value int The path length

ViolationPath::getParent()

PropertyPath getParent() Returns the parent property path. The parent property path is the one that contains the same items as this one except for the last one. If this property path only contains one item, null is returned. Return Value PropertyPath The parent path or null

ViolationPath::getIterator()

ViolationPathIterator getIterator() Returns a new iterator for this path. Return Value ViolationPathIterator

ViolationPath::isIndex()

bool isIndex(int $index) Returns whether the element at the given index is an array index. Parameters int $index The index in the property path Return Value bool Whether the element at this index is an array index Exceptions OutOfBoundsException If the offset is invalid

ViolationMapperInterface

interface ViolationMapperInterface Methods mapViolation(ConstraintViolation $violation, FormInterface $form, bool $allowNonSynchronized = false) Maps a constraint violation to a form in the form tree under the given form. Details mapViolation(ConstraintViolation $violation, FormInterface $form, bool $allowNonSynchronized = false) Maps a constraint violation to a form in the form tree under the given form. Parameters ConstraintViolation $violat

ViolationPath

class ViolationPath implements IteratorAggregate, PropertyPathInterface Methods __construct(string $violationPath) Creates a new violation path from a string. string __toString() Returns the string representation of the property path. int getLength() Returns the length of the property path, i.e. the number of elements. PropertyPath getParent() Returns the parent property path. array getElements() Returns the elements of the property path as array. string getElement

ViolationMapper

class ViolationMapper implements ViolationMapperInterface Methods mapViolation(ConstraintViolation $violation, FormInterface $form, bool $allowNonSynchronized = false) Maps a constraint violation to a form in the form tree under the given form. Details mapViolation(ConstraintViolation $violation, FormInterface $form, bool $allowNonSynchronized = false) Maps a constraint violation to a form in the form tree under the given form. Parameters Cons

Version::normalize()

static string|null normalize(string $version, int|null $precision) Normalizes a version string to the number of components given in the parameter $precision. Examples: Version::normalize('1.2.3', 1); // => '1' Version::normalize('1.2.3', 2); // => '1.2' Parameters string $version A version string int|null $precision The number of components to include. Pass NULL to return the version unchanged. Return Value string|null The normalized version or NULL if it cou