Skip to content

Commit 29b40ac

Browse files
committed
Remove unnecessary fallbacks when args accept null
1 parent 8ce4da2 commit 29b40ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/JsonSchema/Constraints/UndefinedConstraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu
3737
return;
3838
}
3939

40-
$path = $this->incrementPath($path ?: new JsonPointer(''), $i);
40+
$path = $this->incrementPath($path, $i);
4141
if ($fromDefault) {
4242
$path->setFromDefault();
4343
}
@@ -140,7 +140,7 @@ protected function validateCommonProperties(&$value, $schema, JsonPointer $path,
140140
if (!$this->getTypeCheck()->propertyExists($value, $required)) {
141141
$this->addError(
142142
ConstraintError::REQUIRED(),
143-
$this->incrementPath($path ?: new JsonPointer(''), $required), array(
143+
$this->incrementPath($path, $required), array(
144144
'property' => $required
145145
)
146146
);

0 commit comments

Comments
 (0)