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

Request #11087 Change private methods to protected to allow subclassing of standards
Submitted: 2007-05-21 13:07 UTC
From: troehr Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 0.6.0)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-05-21 13:07 UTC] troehr (Torsten Roehr)
Description: ------------ Please change the private methods in the standards classes to protected to allow subclassing certain sniffs. This is useful when only a certain aspect of a sniff should be modified. Otherwise the whole class needs to be copied/duplicated even if only one method should be changed. Thanks, Torsten

Comments

 [2007-05-21 23:06 UTC] squiz (Greg Sherwood)
Almost all private functions are in the commenting sniffs. Are these the classes you are talking about?
 [2007-05-22 08:00 UTC] troehr (Torsten Roehr)
Yes. The problem is that the extending class cannot call those methods. This results in: Fatal error: Call to private method PEAR_Sniffs_Commenting_FileCommentSniff::_ge tIndentation() from context 'PEAREXTENDED_Sniffs_Commenting_FileCommentSniff' in C:\w amp\htdocs\...\PEAR\PHP\CodeSniffer\Standards\PEAREXTENDED\Sniffs \Commenting\FileCommentSniff.php on line 170 In that class I am just defining/overwriting the processTags() method.
 [2007-06-06 03:52 UTC] squiz (Greg Sherwood)
This bug has been fixed in CVS. 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. All those private methods are now protected.