简体   繁体   English

PHP:函数参数怪异我找不到规则

[英]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 . 出于某些原因,在PHPStorm 8中-整个行都标有Expected \\App\\Log but got string

Isn't what I'm doing legitimate? 我的行为不合法吗? where is \\App\\Log coming into the game? \\ App \\ Log在哪里进入游戏? Is this something real or some kind of IDE cancer? 这是真实的还是某种IDE癌症?

This answer worked for me: 这个答案对我有用:

  1. Go to File → Invalidate Caches... and restart the IDE. 转到文件→使缓存无效...,然后重新启动IDE。
  2. Check where the IDE takes you to if you Ctrl +click on log in MyLogClass::log(MyLogClass::TEST1); 如果按Ctrl键并单击MyLogClass::log(MyLogClass::TEST1); log ,请检查IDE将您带到的位置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). 显示有关该调用的IDE的屏幕快照(在该行的log中, 按Ctrl + Q或View→Quick Documentation)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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