Skip to content

Commit f2990bc

Browse files
committed
add fluent setters for additionalProperties and items
1 parent 36e8c6b commit f2990bc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Schema.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,26 @@ private function process($data, $import = true, DataPreProcessor $preProcessor =
418418
return $result;
419419
}
420420

421+
/**
422+
* @param bool|Schema $additionalProperties
423+
* @return Schema
424+
*/
425+
public function setAdditionalProperties($additionalProperties)
426+
{
427+
$this->additionalProperties = $additionalProperties;
428+
return $this;
429+
}
430+
431+
/**
432+
* @param Schema|Schema[] $items
433+
* @return Schema
434+
*/
435+
public function setItems($items)
436+
{
437+
$this->items = $items;
438+
return $this;
439+
}
440+
421441

422442
private function fail(InvalidValue $exception, $path)
423443
{

0 commit comments

Comments
 (0)