The following shows when I'm checking the default AppView class of a 4.2 CakePHP app

Class App\View\AppView does not implement abstract methods:
function dispatchEvent(string $name, array|null $data = null, object|null $subject = null)
function setEventManager(\Cake\Event\EventManagerInterface $eventManager)
function getEventManager()PHP(PHP2414)
keyword extends
Classes are extended using the keyword 'extends'. This defines a parent class.

I have checked that said methods are implemented in the \Cake\View\View class using a trait ¿Do I have to do something else for this to work? I have installed the extension in VS Code and have installed the cakedc/cakephp-phpstan dev package in composer and also added the - vendor/cakedc/cakephp-phpstan/extension.neon line to the phpstan.neon file. Aside from that the file in particular doesn't have special annotations, so I was wondering if there is a way to make the extension acknowledge the trait method.

    SantiagoHenaoGonzalez Thank you for reporting that.

    Trait methods should be handled without issues like this.

    Aren't any trait uses underlined as unknown?

    Isn't there anything in VSCode's OUTPUT window, PHP Language Server tab?

    Thank you

      JakubMisek I checked the output and nothing special shows up. When I check the View class decalration the 'use' statement of the trait that implements those methods doesn't show any problems. I noticed something weird aftera few tries, the moment I open the file that contains the View class and focus on it, the error in AppView dissapears, I close it and it appears again, nothing shows up in the PHP Language Server Output during this process.

        Write a Reply...