LoginSignup
2
0

More than 3 years have passed since last update.

PHPStormで「Undefined Class」が出たら試しておきたいこと

Last updated at Posted at 2020-11-19

解決法

エディタ上部のFile→Invalidate Caches/Restartを選択
スクリーンショット 2020-11-13 17.02.14.png

スクリーンショット 2020-11-13 17.02.45.png

The caches will be invalidated and rebuilt on the next startup.
Would you like to continue?
「キャッシュは無効化されて次回の起動時に再構築されます。続けますか?」と聞かれます。
「Invalidate and Restart」を選ぶとキャッシュが削除され、エディタが自動で再起動します。
これで完了!

経緯

つい先ほどまで出ていなかったのに、なぜか「Undefined Class」という表示が急に出現。
もちろん、クラスは定義されています。
とにかく調べてみたら、PhpStormでたまに起こるのだとか。動作高速化のためのキャッシュがたまに悪さをするようですね。
他の方の記事ではコンパイルエラーが無いにもかかわらず実行時にエラーが出てしまうという現象の時にも有効だったようなので、お試しください。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0