Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enforce long syntax for array declaration in phpstorm?

I am quite used to using the short array syntax [] instead of the longer one array(). Now, I am forced by the server environment into using the longer one.

PhpStorm allows to enforce the shorter syntax for arrays in Code Style > Php > Array declaration style > Force short declaration style:

PhpStorm Code Style Array Declartion Style Force Short Style

Now, I want to achieve the reverse.

Having it automatically replaced would be preferred, but it would already help to mark the short declaration style as an error.

like image 792
k0pernikus Avatar asked Oct 13 '14 16:10

k0pernikus


1 Answers

From Project settings > PHP choose the PHP Language Level to 5.3 and it will mark the short array syntax as error.

like image 128
v.radev Avatar answered Oct 05 '22 05:10

v.radev