class PropertyPath
Contains utility methods for dealing with property paths.
For more extensive functionality, use Symfony's PropertyAccess component.
@author Bernhard Schussek <bschussek@gmail.com>
Hierarchy
- class \Symfony\Component\Validator\Util\PropertyPath
Expanded class hierarchy of PropertyPath
6 files declare their use of PropertyPath
- ConstraintViolationBuilder.php in vendor/
symfony/ validator/ Violation/ ConstraintViolationBuilder.php - ConstraintViolationBuilder.php in core/
lib/ Drupal/ Core/ Validation/ ConstraintViolationBuilder.php - ExecutionContext.php in vendor/
symfony/ validator/ Context/ ExecutionContext.php - ExecutionContext.php in core/
lib/ Drupal/ Core/ Validation/ ExecutionContext.php - RecursiveContextualValidator.php in vendor/
symfony/ validator/ Validator/ RecursiveContextualValidator.php
File
-
vendor/
symfony/ validator/ Util/ PropertyPath.php, line 21
Namespace
Symfony\Component\Validator\UtilView source
class PropertyPath {
/**
* 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 (".").
*/
public static function append(string $basePath, string $subPath) : string {
if ('' !== $subPath) {
if ('[' === $subPath[0]) {
return $basePath . $subPath;
}
return '' !== $basePath ? $basePath . '.' . $subPath : $subPath;
}
return $basePath;
}
/**
* Not instantiable.
*/
private function __construct() {
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
PropertyPath::append | public static | function | Appends a path to a given property path. |
PropertyPath::__construct | private | function | Not instantiable. |