99use function Psl \Type \bool ;
1010use function Psl \Type \mixed_dict ;
1111use function Psl \Type \non_empty_string ;
12+ use function Psl \Type \nullable ;
1213use function Psl \Type \optional ;
1314use function Psl \Type \shape ;
1415use function Psl \Type \string ;
@@ -235,7 +236,7 @@ public function enums(): Option
235236 public function withEnums (?array $ enums ): self
236237 {
237238 $ new = clone $ this ;
238- $ new ->enums = from_nullable (optional (vec (string ()))->coerce ($ enums ));
239+ $ new ->enums = from_nullable (nullable (vec (string ()))->coerce ($ enums ));
239240
240241 return $ new ;
241242 }
@@ -254,7 +255,7 @@ public function extends(): Option
254255 public function withExtends (?array $ extends ): self
255256 {
256257 $ new = clone $ this ;
257- $ new ->extends = from_nullable (optional (
258+ $ new ->extends = from_nullable (nullable (
258259 shape ([
259260 'type ' => non_empty_string (),
260261 'namespace ' => non_empty_string (),
@@ -487,7 +488,7 @@ public function restriction(): Option
487488 public function withRestriction (?array $ restriction ): self
488489 {
489490 $ new = clone $ this ;
490- $ new ->restriction = from_nullable (optional (mixed_dict ())->coerce ($ restriction ));
491+ $ new ->restriction = from_nullable (nullable (mixed_dict ())->coerce ($ restriction ));
491492
492493 return $ new ;
493494 }
@@ -506,7 +507,7 @@ public function unions(): Option
506507 public function withUnions (?array $ unions ): self
507508 {
508509 $ new = clone $ this ;
509- $ new ->unions = from_nullable (optional (
510+ $ new ->unions = from_nullable (nullable (
510511 vec (
511512 shape ([
512513 'type ' => non_empty_string (),
@@ -565,7 +566,7 @@ public function arrayType(): Option
565566 public function withArrayType (?array $ arrayType ): self
566567 {
567568 $ new = clone $ this ;
568- $ new ->arrayType = from_nullable (optional (
569+ $ new ->arrayType = from_nullable (nullable (
569570 shape ([
570571 'type ' => non_empty_string (),
571572 'itemType ' => non_empty_string (),
0 commit comments