php - ZF2 and PHPCSMD using PSR-2 in NetBeans 7.4 -


In NetBeans 7.4 I am using a PHP: CS plugin that uses PSR-2 rules to control the source code. My partner has only one setting (we have checked this), the same version of the plugin, the same version of NetBusiness. However, after reviewing the code, we have different results.

However this code:

  back to new Jasonmodal (array ('success' = & gt; true, 'data' = & Gt; $ some data,));  

is completely fine (no error, no warning) after the code is reviewed by the PHPCSMD plugin, on colleagues, this error is marked as red in the form of a machine And it says that the brake PSR-2 rule is because the partition lines must start with a new line.

According to the PSR-2 documentation, this exact case has not been mentioned anywhere, so I do not know that it is labeled as an error peer machine correctly or not (So ​​it has not been correctly marked as an error on my machine :-)) Question: According to PSR-2, this is really wrong:

  New Jason Model (array ('success' = & Gt; true, 'data' = & gt; $ some data,));  

and should only use it:

  back to new JasonModal (array ('success' = & Gt; true, 'data' = & gt; $ some data,));  

???

Both are valid, PSR2 compliant, building with both of you ( Bash can test the statement phpcs :

  you @ server ~ $ phpcs --standard = PSR2 & lt; & Lt; EOF returned new JsonModel (array ('success' = & gt; true, 'data' = & gt; $ some data,)); EOF  

and:

  you @ server ~ $ phpcs --standard = PSR2 & lt; & Lt; EOF New JsonModel (array ('success' returned = true; 'data' = & gt; $ some data;)); EOF  

BTW, I have used:

  PHP_CodeSniffer version 1.5.1 (static) by Squiz (http://www.squiz.net)  

Comments