Skip to content

Infer types from Reflection objects #3

Description

@ghostwriter

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 */

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions