1

If I let the code inspection run through my CakePHP project code all magic methods like findById() or findAllByName() are marked as "undefined".

In the background they call the __call() method of the Model.php class.

Is there an option that those are not marked as an error any more? It is spamming my inspection output. Not a serious problem, but it would be nice to get rid of an error, which is not an error.

LazyOne
  • 137,403
  • 37
  • 338
  • 342
Calamity Jane
  • 1,557
  • 4
  • 21
  • 41
  • You can try `Downgrade severity if __magic methods are present in class` option for that inspection -- it will now be reported as "Weak Warning" instead of "Warning" so it much less noticeable (but still reported). The other way -- declare them via PHPDoc `@method` way so IDE is ware of them -- just look around on this site or internet in general -- there must be already made solutions/instructions for this. – LazyOne Sep 04 '17 at 14:26
  • E.g. https://stackoverflow.com/a/15634488/783119 or perhaps https://stackoverflow.com/a/40487530/783119 . Check other tickets tagged with same tags: https://stackoverflow.com/questions/tagged/cakephp+phpstorm – LazyOne Sep 04 '17 at 14:30
  • I saw those, but regarded them as not helpful. Therefore my question. – Calamity Jane Sep 04 '17 at 15:32
  • 2
    have a look at https://github.com/dereuromark/cakephp-ide-helper – DarkMukke Sep 04 '17 at 16:17
  • That really looks promising, but ist is "only" for cakePhp3, correct? Or does an version for cakePhp2 exist, too? – Calamity Jane Sep 05 '17 at 08:13

0 Answers0