Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #17054 phpcs more strict than PEAR CS regarding function parameter spacing
Submitted: 2010-02-02 23:20 UTC
From: hughitt1 Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.2.2)
PHP Version: 5.2.1 OS: Ubuntu 9.10
Roadmaps: (Not assigned)    
Subscription  


 [2010-02-02 23:20 UTC] hughitt1 (Keith Hughitt)
Description: ------------ According to the PEAR CS, it is acceptable to use more than one space in between function parameters to promote readability, e.g. $this->callSomeFunction('param1', 'second', true); $this->callSomeFunction('parameter2', 'third', false); $this->callSomeFunction('3', 'verrrrrrylong', true); (http://pear.php.net/manual/en/standards.funcalls.php) The above, however, is treated as an ERROR by phpcs, which outputs something along the lines of: 109 | ERROR | Expected 1 space after comma in function call; 4 found 110 | ERROR | Expected 1 space after comma in function call; 4 found 111 | ERROR | Expected 1 space after comma in function call; 3 found Ideally, phpcs would ignore spacing after between function params.

Comments

 [2010-02-03 04:14 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Assigned -Assigned To: +Assigned To: squiz
When did that get in there? What a crazy change :) IMO, standards should be clear without exceptions or else how are people meant to follow them. (Not your fault of course, just venting) To properly support it I'd need to check the function call names and proper alignment, but there is no way I'm going to waste time doing that. I'll go with your suggestion of just removing the check from the PEAR standard.
 [2010-02-18 06:11 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.