Skip to content
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

Better evaluation of complex expression with variables used to construct template paths #92

Closed
MartinMystikJonas opened this issue Dec 1, 2022 · 2 comments

Comments

@MartinMystikJonas
Copy link
Collaborator

MartinMystikJonas commented Dec 1, 2022

Option 1: Use PHPStan node visitors to evaluate complex expression with variables used to construct template paths

Use visitor to evaluate every variable assign so it could be used in evaluation of following expressions.

https://phpstan.org/blog/preprocessing-ast-for-custom-rules

Option 2: Use custom Scope class

See solution proposed here phpstan/phpstan#8454 (reply in thread)

Option 3: Type specifying extension

Could we use type specifying extension to define custom type RelativePathType (extendin ConstantStringType) that would hold constant values here and add it as result of given expressions?

@MartinMystikJonas MartinMystikJonas changed the title Use PHPStan node visitors to evaluate complex expression with variables used to construct template paths Better evaluation of complex expression with variables used to construct template paths Dec 3, 2022
@MartinMystikJonas
Copy link
Collaborator Author

Might be solved on PHPStan level by phpstan/phpstan-src#2050

@MartinMystikJonas
Copy link
Collaborator Author

Resolved by by phpstan/phpstan-src#2050

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant