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)    
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:
Solve the problem : 33 + 50 = ?

 [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


 [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: d9d16f63494ac4