Getting undefined method from trait #4318
-
I am trying to increase PHPStan levels on my Craft CMS project. I am getting a "Call to undefined method yii\base\View::renderTemplate()." error on level 2 and I don't fully understand why. The project has a module that calls: I recreated the error based on what happens in Craft: I am not sure if this is a bug, or if I should add type hints in the project code, or if this is something that needs to be fixed through a PHPStan extension? For the record, I started working on https://github.com/studio-stomp/phpstan-craftcms a while ago, so anything that needs to address the framework I could add to that. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi, the class Application doesn't have |
Beta Was this translation helpful? Give feedback.
Hi, the class Application doesn't have
renderTemplate
method, so PHPStan is correct here. How come that it doesn't crash with an "undefined method" when running the app?