Bug report
If PHPStan is instructed to trust typehints, it does it only for top-level code, not for code inside a method.
Code snippet that reproduces the problem
https://phpstan.org/r/08e5a1cd-bb50-45c5-ab70-b5530b2815dd
Expected output
PHPStan should trust the typehint if it is instructed to do so.
The dependency between the two variables is another issue that doesn't need to be resolved here.
Bug report
If PHPStan is instructed to trust typehints, it does it only for top-level code, not for code inside a method.
Code snippet that reproduces the problem
https://phpstan.org/r/08e5a1cd-bb50-45c5-ab70-b5530b2815dd
Expected output
PHPStan should trust the typehint if it is instructed to do so.
The dependency between the two variables is another issue that doesn't need to be resolved here.