phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

Result cache is not invalidated after DI container dump

Open Wirone opened this issue 3 years ago • 19 comments

Imagine scenario:

  • With bin/console cache:clear you dump DI container
  • In code you use $container->get('foo');
  • PHPStan reports Service "foo" is not registered in the container
  • You fix DI definition by adding foo service
  • cache:clear again, so DI definition contains foo service
  • Because of result cache PHPStan reports errors even though DI container definition has changed and service is registered

Expected result: refreshing DI container invalidates result cache for files that uses DI (have errors reported by Symfony extension).

Wirone avatar Feb 17 '22 09:02 Wirone