Skip to content

Commit 4a1f07f

Browse files
emmanuelGuitonEmmanuel GUITONSeldaek
authored
Fixed method convertJsonPointerIntoPropertyPath() that was not in the right class (JsonSchema\Constraints\Constraint instead of JsonSchema\Constraints\BaseConstraint). Closes #654 (#655)
Co-authored-by: Emmanuel GUITON <[email protected]> Co-authored-by: Jordi Boggiano <[email protected]>
1 parent b1a83e4 commit 4a1f07f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/JsonSchema/Constraints/BaseConstraint.php

+17
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,21 @@ public static function jsonPatternToPhpRegex($pattern)
165165
{
166166
return '~' . str_replace('~', '\\~', $pattern) . '~u';
167167
}
168+
169+
/**
170+
* @param JsonPointer $pointer
171+
*
172+
* @return string property path
173+
*/
174+
protected function convertJsonPointerIntoPropertyPath(JsonPointer $pointer)
175+
{
176+
$result = array_map(
177+
function ($path) {
178+
return sprintf(is_numeric($path) ? '[%d]' : '.%s', $path);
179+
},
180+
$pointer->getPropertyPaths()
181+
);
182+
183+
return trim(implode('', $result), '.');
184+
}
168185
}

src/JsonSchema/Constraints/Constraint.php

-17
Original file line numberDiff line numberDiff line change
@@ -215,21 +215,4 @@ protected function getTypeCheck()
215215
{
216216
return $this->factory->getTypeCheck();
217217
}
218-
219-
/**
220-
* @param JsonPointer $pointer
221-
*
222-
* @return string property path
223-
*/
224-
protected function convertJsonPointerIntoPropertyPath(JsonPointer $pointer)
225-
{
226-
$result = array_map(
227-
function ($path) {
228-
return sprintf(is_numeric($path) ? '[%d]' : '.%s', $path);
229-
},
230-
$pointer->getPropertyPaths()
231-
);
232-
233-
return trim(implode('', $result), '.');
234-
}
235218
}

0 commit comments

Comments
 (0)