2

I'm getting an error in phpStorm in the ZF3 controller classes with the message:

Method 'flashMessenger' not found in ...Controller

At the same time it is working like a charm. But I would like this IDE not found error to be removed anyway.

The application was updated to ZF3 and I installed the flash messenger plugin found on Zendframework GitHub

Thanks for the help.

SiHa
  • 7,830
  • 13
  • 34
  • 43
Floris
  • 2,727
  • 2
  • 27
  • 47

2 Answers2

2

The error occurs because controller plugins aren't methods on the class, but classes themselves returned in the controller's __call method.

This means that the PhpStorm 'Undefined method' PHP inspection can't see the method in the class. It can be disabled in the settings under Editor -> Inspections -> PHP, but this will obviously stop the inspection from identifying actual errors as well.

avy
  • 644
  • 6
  • 16
0

You can add the following above the line to silence the inspection for that one line of code:

/** @noinspection PhpUndefinedMethodInspection */
ddelrio1986
  • 279
  • 1
  • 3
  • 15