简体   繁体   中英

PHP: Function parameter weirdness I can't find a rule for

I have a class with a static function:

public static function log($logEntryType) 
{
...
{

in the same class I have a few CONSTS:

const TEST1 = 'test1';
const TEST2 = 'test2';

From another class I am making the following call;

MyLogClass::log(MyLogClass::TEST1);

For some reason in PHPStorm 8 -- the whole line is marked with a Expected \\App\\Log but got string .

Isn't what I'm doing legitimate? where is \\App\\Log coming into the game? Is this something real or some kind of IDE cancer?

This answer worked for me:

  1. Go to File → Invalidate Caches... and restart the IDE.
  2. Check where the IDE takes you to if you Ctrl +click on log in MyLogClass::log(MyLogClass::TEST1); .
  3. Show a screenshot of what the IDE thinks about that call ( Ctrl + Q or View → Quick Documentation on log in that line).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM