phpstan / phpstan-nette

Nette Framework class reflection extension for PHPStan & framework-specific rules
MIT License
100 stars 35 forks source link

Property with #[Inject] attribute is initialized #133

Open mabar opened 1 year ago

mabar commented 1 year ago

Adding support for inject attributes https://doc.nette.org/en/best-practices/inject-method-attribute#toc-inject-attributes

I am a bit stuck on why the test is failing - same code with native ReflectionProperty works just fine https://3v4l.org/3HF1T

Also my usual primitive debugging methods don't work as usual - var_dump() in tested code makes it stuck indefinitely and e.g. \PHPUnit\Framework\assertFalse(true) in tested code does not make the test fail

For the phpstan failure - should I just add it to ignored? Class does not have to exist in this case.

lulco commented 10 months ago

@mabar it's because of installing nette/di in lowest version (3.0.0) where the class Nette\DI\Attributes\Inject doesn't exist