Skip to content

Commit e5efe21

Browse files
committed
Fix: Mark check() and coerce() as deprecated
1 parent dfdcb5b commit e5efe21

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

bin/validate-json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ if (isset($arOptions['--dump-schema'])) {
217217

218218
try {
219219
$validator = new JsonSchema\Validator();
220-
$validator->check($data, $schema);
220+
$validator->validate($data, $schema);
221221

222222
if ($validator->isValid()) {
223223
if(isset($arOptions['--verbose'])) {

demo/demo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// Validate
88
$validator = new JsonSchema\Validator();
9-
$validator->check($data, (object) array('$ref' => 'file://' . realpath('schema.json')));
9+
$validator->validate($data, (object) array('$ref' => 'file://' . realpath('schema.json')));
1010

1111
if ($validator->isValid()) {
1212
echo "The supplied JSON validates against the schema.\n";

src/JsonSchema/Validator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public function validate(&$value, $schema = null, $checkMode = null)
7474

7575
/**
7676
* Alias to validate(), to maintain backwards-compatibility with the previous API
77+
*
78+
* @deprecated
7779
*/
7880
public function check($value, $schema)
7981
{
@@ -82,6 +84,8 @@ public function check($value, $schema)
8284

8385
/**
8486
* Alias to validate(), to maintain backwards-compatibility with the previous API
87+
*
88+
* @deprecated
8589
*/
8690
public function coerce(&$value, $schema)
8791
{

0 commit comments

Comments
 (0)