function PropertyPath::append
Appends a path to a given property path.
If the base path is empty, the appended path will be returned unchanged. If the base path is not empty, and the appended path starts with a squared opening bracket ("["), the concatenation of the two paths is returned. Otherwise, the concatenation of the two paths is returned, separated by a dot (".").
8 calls to PropertyPath::append()
- ConstraintViolationBuilder::atPath in vendor/
symfony/ validator/ Violation/ ConstraintViolationBuilder.php - Stores the property path at which the violation should be generated.
- ConstraintViolationBuilder::atPath in core/
lib/ Drupal/ Core/ Validation/ ConstraintViolationBuilder.php - Stores the property path at which the violation should be generated.
- ExecutionContext::getPropertyPath in vendor/
symfony/ validator/ Context/ ExecutionContext.php - Returns the property path to the value that the validator is currently validating.
- ExecutionContext::getPropertyPath in core/
lib/ Drupal/ Core/ Validation/ ExecutionContext.php - Returns the property path to the value that the validator is currently validating.
- RecursiveContextualValidator::validateClassNode in vendor/
symfony/ validator/ Validator/ RecursiveContextualValidator.php - Validates a class node.
File
-
vendor/
symfony/ validator/ Util/ PropertyPath.php, line 32
Class
- PropertyPath
- Contains utility methods for dealing with property paths.
Namespace
Symfony\Component\Validator\UtilCode
public static function append(string $basePath, string $subPath) : string {
if ('' !== $subPath) {
if ('[' === $subPath[0]) {
return $basePath . $subPath;
}
return '' !== $basePath ? $basePath . '.' . $subPath : $subPath;
}
return $basePath;
}