opened
CarsonF
username_0
A real world example of this is with Flysystem. You pass in a handler object to [ `Filesystem::get()`](https://github.com/thephpleague/flysystem/blob/master/src/Filesystem.php#L359-L372) which is then populated and returned.
```php
$file = $filesystem->get('foo.txt', new File());
```

---

On a side note, I'm pretty confused on what's allowed in `PhpTypeProvider3#getType`.

Can you use an method of the (sub)element given or are you restricted to only certain ones?

Like `PhpReference` has `getFQN`, `resolveLocalType`, `resolveLocalType`, `resolveGlobal`, `getType`. Are all of these ok to use? or only some? Do none of these need the `PhpIndex`?
Allow resolving parameter types from new expressions. `foo(new Bar())`
issue
created
Haehnchen
username_1
merged :+1: 

i never tried `resolveLocal...` they are new since versions, by naming they are valid in this scope to me. i am just using: `getFQN`, `getType`, `getClassReferences`, `getTypes`.

https://github.com/username_1/idea-php-phpunit-plugin/tree/master/src/de/espend/idea/php/phpunit/type will also help you to investigate allowed methods.
comment