Skip to content

Infer types from Reflection objects #3

@ghostwriter

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

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