Bug #19411 [Fbk->Csd]: magic method error on __construct()

From: Date: Fri, 11 May 2012 05:40:37 +0000
Subject: Bug #19411 [Fbk->Csd]: magic method error on __construct()
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8642@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19411&edit=1 ID: 19411 Updated by: gsherwood@squiz.net Reported By: jpkeller at gmail dot com Summary: magic method error on __construct() -Status: Feedback +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: Ubuntu Package Version: 1.3.3 PHP Version: 5.3.5 Assigned To: squiz Roadmap Versions: New Comment: -Status: Feedback +Status: Closed Fixed in git repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/766f102ca453e685e7a445f28 8043213cb7cde11 Thanks again for the sample file. There is no way I could have tracked this down without it. Previous Comments: ------------------------------------------------------------------------ [2012-05-11 06:21:11] squiz Thanks a lot for sending the sample file. The problem is related to the ignore comments. The smallest bit of code to reproduce for me is: /* @codingStandardsIgnoreStart */ class MyClass { /* @codingStandardsIgnoreEnd */ public function __construct() {} } ------------------------------------------------------------------------ [2012-05-08 22:02:57] vanderhuge Thanks for the quick response - I'll clarify. My occasionally I mean it doesn't error on every __construct() we have and I haven't been able to suss out the pattern of which it has problems with and which it does not. These projects are all hosted on the same server / use the same version of PHP / same version of PHPCS. We use basic PEAR standards without customization. For standards training (punishment?) we occasionally have devs bring a random file under standards - I'll e-mail you a copy of the most recent file we've run into it on. ------------------------------------------------------------------------ [2012-05-08 05:26:46] squiz -Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz I can't replicate this. What exactly does "occasionally" mean? The exact same version of PHPCS, PHP and the code you are checking sometimes produces different results, or that PHPCS used on different setups or code is causing issues? Either way, are you able to provide me with code that I can run PHPCS over to make it fail? Also, what standard are you using? Is it a built-in one or a custom one? ------------------------------------------------------------------------ [2012-05-08 03:10:23] vanderhuge Description: ------------ Occasionally we've been running into errors where phpcs is reporting valid magic functions as invalid due to the double underscore. "156 | ERROR | Function name "__construct" is invalid; only PHP magic methods should be prefixed with a double underscore" ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19411&edit=1

« previous php.pear.bugs (#8642) next »