Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContainerDynamicReturnTypeExtension doesn't resolve service ID from variable #563

Closed
mglaman opened this issue May 12, 2023 · 0 comments · Fixed by #574
Closed

ContainerDynamicReturnTypeExtension doesn't resolve service ID from variable #563

mglaman opened this issue May 12, 2023 · 0 comments · Fixed by #574
Labels
bug Something isn't working

Comments

@mglaman
Copy link
Owner

mglaman commented May 12, 2023

Bug report

Found on https://www.drupal.org/project/drupal/issues/3359931

Running PHPStan on *all* files.
 ------ --------------------------------------------------------------------- 
  Line   core/modules/system/src/Form/DevelopmentSettingsForm.php             
 ------ --------------------------------------------------------------------- 
  153    Function deleteAll not found.                                        
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ --------------------------------------------------------------------- 

Due to old/bad logic on ::getServiceId https://github.com/mglaman/phpstan-drupal/blob/main/src/Type/ContainerDynamicReturnTypeExtension.php#L79C24-L90

Code snippet that reproduces the problem

        $cache_bins = ['page', 'dynamic_page_cache', 'render'];
        foreach ($cache_bins as $cache_bin) {
          if ($container->has($cache_bin)) {
            $container->get($cache_bin)>deleteAll();
          }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant