welovewordpress / SublimePhpTidy

Plugin for Sublime Text 2 to format PHP code to meet the WordPress Coding Standards using a modified version of phptidy
GNU General Public License v2.0
109 stars 30 forks source link

non compliant spacing #16

Open nickdaugherty opened 11 years ago

nickdaugherty commented 11 years ago

the plugin will produce non-WordPress compliant spacing in various conditions. For example:

Array indexes - if array index is a variable, space should be added between brackets like so:

[ $i ]

but if index is not a variable, the space should be removed:

['tags']

Type casting should be in the form of (note the lack of space around the type):

foreach ( (array) $foo as $bar ) {

On logical comparisons, a space should be added before and after the ! symbol:

if ( ! $foo ) {