Phil
Phil

Reputation: 185

Why is my PHP file class recognized as text file?

I'm working on a Laravel project and when I was creating a new file I miss spelled the php extension ("php") but I didn't notice until I clicked enter so my PHP class files now appear as text files in PhpStorm and appears no hints whenever I write something in any php file.

Problem

Im using PhpStorm 2020.2.

Upvotes: 0

Views: 884

Answers (2)

Osama Alvi
Osama Alvi

Reputation: 679

And if you already did as @LazyOne suggested and your file still showing as text then right click the file and do this:

enter image description here

Upvotes: 0

LazyOne
LazyOne

Reputation: 165118

  1. Settings (Preferences on macOS) | Editor | File Types
  2. Locate "PHP" entry in the top list (Recognized File Types)
  3. Ensure that the middle list (File Name Patterns) has *.php entry there.

enter image description here

If it's not there then add it. Looks like you somehow re-assigned it to the "Text" file type.

enter image description here

enter image description here


Altought blade.php get recognized right,

That's because *.blade.php is assigned to separate/dedicated "Blade" file type (so IDE can provide Blade-specific support there).

Upvotes: 2

Related Questions