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

Bug #19546 Error thrown for __call() method in traits
Submitted: 2012-08-06 07:31 UTC
From: hinikato Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version SVN)
PHP Version: 5.4.0 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2012-08-06 07:31 UTC] hinikato (Hinikato Dubrai)
Description: ------------ The __call() method in trait recognized with error. Test script: --------------- trait Foo { function __call($method, $args) { } } Expected result: ---------------- Errors should not be displayed. Actual result: -------------- phpcs --standard=PSR2 d:\system\home\localhost\www\test.php FILE: D:\system\home\localhost\www\test.php -------------------------------------------------------------------------------- FOUND 1 ERROR(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 6 | ERROR | Function name "__call" is invalid; only PHP magic methods should | | be prefixed with a double underscore -------------------------------------------------------------------------------- Time: 0 seconds, Memory: 1.50Mb

Comments

 [2012-08-06 07:54 UTC] squiz (Greg Sherwood)
-Summary: Recognizing __call() method in traits. +Summary: Error thrown for __call() method in traits -Assigned To: +Assigned To: squiz
 [2012-08-06 08:00 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
Committed a fix to the github repo. You'll need both these: https://github.com/squizlabs/PHP_CodeSniffer/commit/cce7a5775bb3c8c9c2b6ff5a8ff 5ed5c5082dc91 https://github.com/squizlabs/PHP_CodeSniffer/commit/5fed8ba528af3c5e6df6db4779 2d3cf32566747b