Skip to content

Commit

Permalink
Merge pull request #12 from veewee/allow-empty-enums
Browse files Browse the repository at this point in the history
Allow empty enumeration strings
  • Loading branch information
veewee authored Apr 2, 2024
2 parents eaaa1b9 + b255ef4 commit 5455dc5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Metadata/Model/TypeMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use function Psl\Type\non_empty_string;
use function Psl\Type\optional;
use function Psl\Type\shape;
use function Psl\Type\string;
use function Psl\Type\vec;

final class TypeMeta
Expand All @@ -31,7 +32,7 @@ final class TypeMeta
private $docs;

/**
* @var list<non-empty-string>|null
* @var list<string>|null
*/
private $enums;

Expand Down Expand Up @@ -171,7 +172,7 @@ public function withDocs(?string $docs): self
}

/**
* @return Option<list<non-empty-string>>
* @return Option<list<string>>
*/
public function enums(): Option
{
Expand All @@ -184,7 +185,7 @@ public function enums(): Option
public function withEnums(?array $enums): self
{
$new = clone $this;
$new->enums = optional(vec(non_empty_string()))->coerce($enums);
$new->enums = optional(vec(string()))->coerce($enums);

return $new;
}
Expand Down

0 comments on commit 5455dc5

Please sign in to comment.