ongr-archive / ongr-strict-standard

[NOT MAINTAINED] Strict PHPCS standard for PSR-2 code based on Squiz standards
MIT License
13 stars 14 forks source link

Investigate concatenation (.) operator usage #49

Closed tautrimas closed 9 years ago

tautrimas commented 9 years ago

Investigate, if more often than not spaces are left or removed around . operator in most popular frameworks.

saimaz commented 9 years ago

+1 for . with spaces around

Well, maybe we should follow other operators convention because now it's the same like

if ($a+$b) {

So why to use $a.'_' when with spaces it will look much cleaner?

$a.'_';
$a . '_';
tautrimas commented 9 years ago

Here are the results:

Framework Is space
CakePHP true
Laravel false
Phalcon true
Silex false
Symfony false
YII true
Zend 2 true

Statistics are approximately the same, therefore we leave spaces due to argument above.