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

Bug #19691 SubversionPropertiesSniff fails to find missing properties
Submitted: 2012-11-05 17:14 UTC Modified: 2012-12-04 00:02 UTC
From: kwinahradsky Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.1)
PHP Version: 5.3.10 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2012-11-05 17:14 UTC] kwinahradsky (Kevin Winahradsky)
Description: ------------ The "$properties += $this->properties;" line in the process function of the Generic_Sniffs_VersionControl_SubversionPropertiesSniff class causes properties you are looking for to be added to the properties that exist. This causes the test for missing properties to fail as the code now thinks the file has all the properties you are looking for it to have when it really doesn't.

Comments

 [2012-11-06 04:46 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz
I didn't write this one, so I really have no idea why that line is in there. But it doesn't make any sense to me either. I've removed it and pushed a commit: https://github.com/squizlabs/PHP_CodeSniffer/commit/8787a9dbb9b038fbafd1c78da 45846253e9b56f6 If you remove that line, does the sniff work for you?
 [2012-11-06 08:28 UTC] kwinahradsky (Kevin Winahradsky)
Changing it to something like "$allProperties = $properties + $this->properties;" and then iterating over $allProperties in the foreach loop is what seems to be working for me.
 [2012-11-06 21:12 UTC] squiz (Greg Sherwood)
Thanks Kevin. I didn't read the code properly. I committed a new fix: https://github.com/squizlabs/PHP_CodeSniffer/commit/70836241a584d8ddcecfc3f5db 09d10827982da0
 [2012-12-04 00:02 UTC] squiz (Greg Sherwood)
-Status: Feedback +Status: Closed