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

Bug #20136 Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff and Traits
Submitted: 2013-11-28 15:09 UTC
From: schmkr Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.0)
PHP Version: 5.4.21 OS: OSX
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 41 + 29 = ?

 
 [2013-11-28 15:09 UTC] schmkr (Alwin Schoemaker)
Description: ------------ If you import Traits into a class and change its visibility, like this: ---- <?php trait HelloWorld { public function sayHello() { echo 'Hello World!'; } } // Change visibility of sayHello class MyClass1 { use HelloWorld { sayHello as private; } } --- You get an error from the PSR2_Sniffs_Classes_PropertyDeclarationSniff that the scope keyword must be followed by a single space. But I don't think this should not be the case for traits. Expected result: ---------------- No errors Actual result: -------------- ERROR | Scope keyword "private" must be followed by a single space

Comments

 [2013-11-29 09:44 UTC] squiz (Greg Sherwood)
-Summary: PSR2_Sniffs_Classes_PropertyDeclarationSniff and Traits +Summary: Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff and Traits -Assigned To: +Assigned To: squiz
That errors actually comes from the Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff class, but I can replicate it easily.
 [2013-11-29 09:46 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
Fix committed to github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/0622b323c598b44f498df843ac d9d16f63494ac4