phpstorm warning php variable might not have been defined

前端 未结 2 1926
天涯浪人
天涯浪人 2020-12-09 13:59


        
2条回答
  •  没有蜡笔的小新
    2020-12-09 14:20

    You can tell PHPStorm to ignore undefined variables reports if require on include statement are located in the same execution flow before the variable access. You'll find it in 'Undefined variable' - Ignore 'include' and 'require' statements. It is enabled by default, so you should disable it.

    enter image description here

    Note: The setting is in File > Settings (Ctrl+Alt+S) > Project Settings > Inspections > PHP > Undefined > Undefined variable

提交回复
热议问题