-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array key cannot contain class name #337
Comments
danog
added a commit
to zoonru/Valinor
that referenced
this issue
Feb 27, 2023
Ran into this today as well when trying to validate an array shape that contained an enum. Quote the keys as below fixes it: final class AddContact
{
public function __construct(
// other fields
/**
* @var array{
* "name": string,
* "sector": Sector|null,
* "email": string|null,
* "website": string|null,
* "vat_number": VatNumber|null,
* "address_line": string|null,
* "locality": string|null,
* "country": Country,
* }
*/
public readonly array $company,
) {
}
} |
Hey there, thanks for the report! This issue should be fixed with #399 and will be part of the next release. 😉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fails with Uncaught CuyZ\Valinor\Mapper\Exception\InvalidMappingTypeSignature: Could not parse the type
array{Test: string}
that should be mapped: Missing second colon symbol for class constantTest::string
.Quoting the
Test
key fixes the issue temporarily.The text was updated successfully, but these errors were encountered: