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

Bug #19270 DuplicateClassName does not handle namespaces correctly
Submitted: 2012-02-01 16:48 UTC
From: sebastian Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.3.2)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2012-02-01 16:48 UTC] sebastian (Sebastian Bergmann)
Description: ------------ The Generic.Classes.DuplicateClassName does not handle namespaced classes/interfaces correctly. Test script: --------------- 1.php <?php namespace A\B; class C {} ?> 2.php <?php namespace D\E; class C {} ?> Expected result: ---------------- None Actual result: -------------- FILE: /home/sb/2.php -------------------------------------------------------------------------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 4 | WARNING | Duplicate class name "C" found; first defined in /home/sb/1.php | | on line 4 --------------------------------------------------------------------------------

Comments

 [2012-02-08 10:58 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Code didn't handle namespaces at all. Should now work for files that contain 1 or more namespace declarations. https://github.com/squizlabs/PHP_CodeSniffer/commit/1ee835c9b36623d4937506965 469a4c60d2c4c50