Karl
Karl

Reputation: 65

PhpStorm Newcomer Here - Variables Different Colours?

I have only just come to PhpStorm and I'm a little stumped at some settings.

I can not understand why one of my variables have a different colour to the rest of them. However I can not work out why this is happening. Any help? I expect the variable to be grey.

Example

Upvotes: 0

Views: 300

Answers (2)

LazyOne
LazyOne

Reputation: 165148

First of all some description for your colors:

  • grey (with underwave effect) means that parameter/variable is unused.
  • that dark red color means that parameter is used (so normal color for parameter)

Now ... you are using custom color scheme that is NOT up to date (not meant to be used with this IDE version). Basically -- that color scheme does not have color defined for that specific style and IDE uses default one (color of a parent style in appropriate styles inheritance hierarchy).

To fix that you will have to adjust your Color Scheme:

  1. Settings/Preferences | Editor | Color Scheme | PHP
  2. The rest -- depends on the element.
    • for function parameter it should be Functions and Methods | Parameter
    • but it could also be something else -- cannot say for sure without having your actual color scheme here on my computer.

Upvotes: 3

Subash
Subash

Reputation: 7256

I am assuming the red color is indicating that the variable is used in the compact method. To verify remove it from using it in the compact method and it should turn grey like your other method parameters.

If you don't like this, you can either change the color scheme or overwrite it.

Upvotes: 0

Related Questions