Domanda

I am using Sonar for QA with PHP. Currently I have started to using traits in source codes but since that, Sonar fails to analyse the source code with phpdepend - it is not able to parse informations in phpdepend output file. I have found that this is a Bug in Sonar's PHP plugin. This bug effectivelly disables using Sonar's PHP Plugin for PHP 5.4 - which is really bad, as php5.3 is reaching end of life soon!

I do not want to believe that nobody uses sonar and QA for PHP 5.4, so there must some solution exists... Thanks for your ideas...

È stato utile?

Soluzione 2

Okey, as this seems to be a little longer and I need support for pdepend in sonar, i have hacked a "solution":

Rename your pdepend command to pdepend_orig and create new pdepend command:

echo "Renaming files that uses traits to *.phphide"

grep --files-with-matches -re "use .*Trait" .  | rename -v s/.php/.phphide/
find -name "*Trait.php" | rename -v s/.php/.phphide/

echo "Running original pdepend"
pdependorig $@

echo "Renaming files that were hidden back to *.php"
find -name "*.phphide" | rename -v s/.phphide/.php/

It hides files where you are using Traits and traits that it is excluded from pdepend. As a hack, it works.

Altri suggerimenti

There's an open JIRA ticket on this: http://jira.codehaus.org/browse/SONARPLUGINS-2303

It's already scheduled for next version of the plugin, but feel free to vote for it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top