ViolationPath
class ViolationPath implements IteratorAggregate, PropertyPathInterface
Methods
Creates a new violation path from a string.
Returns the string representation of the property path.
Returns the length of the property path, i.e. the number of elements.
Returns the parent property path.
Returns the elements of the property path as array.
Returns the element at the given index in the property path.
Returns whether the element at the given index is a property.
Returns whether the element at the given index is an array index.
Returns whether an element maps directly to a form.
Returns a new iterator for this path.
Details
at line line 54
__construct(string $violationPath)
Creates a new violation path from a string.
at line line 119
string
__toString()
Returns the string representation of the property path.
at line line 127
int
getLength()
Returns the length of the property path, i.e. the number of elements.
at line line 135
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.
at line line 156
array
getElements()
Returns the elements of the property path as array.
at line line 164
string
getElement(int $index)
Returns the element at the given index in the property path.
at line line 176
bool
isProperty(int $index)
Returns whether the element at the given index is a property.
at line line 188
bool
isIndex(int $index)
Returns whether the element at the given index is an array index.
at line line 215
bool
mapsForm(int $index)
Returns whether an element maps directly to a form.
Consider the following violation path:
children[address].children[office].data.street
In this example, "address" and "office" map to forms, while "street does not.
at line line 229
ViolationPathIterator
getIterator()
Returns a new iterator for this path.