diff --git a/src/JsonSchema/Constraints/BaseConstraint.php b/src/JsonSchema/Constraints/BaseConstraint.php index ee55922f..2e8339da 100644 --- a/src/JsonSchema/Constraints/BaseConstraint.php +++ b/src/JsonSchema/Constraints/BaseConstraint.php @@ -165,4 +165,21 @@ public static function jsonPatternToPhpRegex($pattern) { return '~' . str_replace('~', '\\~', $pattern) . '~u'; } + + /** + * @param JsonPointer $pointer + * + * @return string property path + */ + protected function convertJsonPointerIntoPropertyPath(JsonPointer $pointer) + { + $result = array_map( + function ($path) { + return sprintf(is_numeric($path) ? '[%d]' : '.%s', $path); + }, + $pointer->getPropertyPaths() + ); + + return trim(implode('', $result), '.'); + } } diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php index f792da5e..53589977 100644 --- a/src/JsonSchema/Constraints/Constraint.php +++ b/src/JsonSchema/Constraints/Constraint.php @@ -215,21 +215,4 @@ protected function getTypeCheck() { return $this->factory->getTypeCheck(); } - - /** - * @param JsonPointer $pointer - * - * @return string property path - */ - protected function convertJsonPointerIntoPropertyPath(JsonPointer $pointer) - { - $result = array_map( - function ($path) { - return sprintf(is_numeric($path) ? '[%d]' : '.%s', $path); - }, - $pointer->getPropertyPaths() - ); - - return trim(implode('', $result), '.'); - } }