-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
ArrayShapes #68
Comments
Yeah, this is something we're going to handle in v3 which is next big thing I'm working on, it is scomplete rewrite of TS transformer using PHPStan for those things instead of phpDocumentor. |
Dear contributor, because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it. |
Could you update the thrown exception to include what class it failed to parse? as a workaround i put an |
phpdocs with arrayshapes fails.
for exemple:
/** @var array{a: int[], b: string[], c: float} $config **/
first it fails at the regexp:
typescript-transformer/src/TypeReflectors/PropertyTypeReflector.php
Line 27 in 37eda5f
then it fails at transpiling (phpDocumentor\Reflection\PseudoTypes\ArrayShape)
typescript-transformer/src/Actions/TranspileTypeToTypeScriptAction.php
Line 60 in af3aca5
it's partly solved with:
typescript-transformer/src/Actions/TranspileTypeToTypeScriptAction.php
Line 61 in 37eda5f
Senario 1
Input:
/** @var array<string, array{a: int[], b: string[], c: float}> $config **/
Expected:
{[key: string]: {a: number[], b: string[], c: number}}
Current: RuntimeException
Unexpected token "", expected '>' at offset 19 on line 1
,due to the regexp only catching
@var array<string, array
The text was updated successfully, but these errors were encountered: