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

Infer types from Reflection objects #3

Open
ghostwriter opened this issue Nov 8, 2023 · 0 comments
Open

Infer types from Reflection objects #3

ghostwriter opened this issue Nov 8, 2023 · 0 comments
Assignees

Comments

@ghostwriter
Copy link
Owner

ghostwriter commented Nov 8, 2023

https://psalm.dev/r/9a84ba1ae6
It would be nice if I could somehow be able to infer a wrapper function like property_get($object, 'propName') -> propType

  • VeeWee
<?php

class X {
    public string $z = '';
}

$x = new X();
$rx = new \ReflectionClass($x);
$z = $rx->getProperty('z');

$v = $z->getValue($x);

/** @psalm-trace $v */
@ghostwriter ghostwriter self-assigned this Nov 8, 2023
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