Browse files

Added additional info for PHP Depend about support phpunit-xml report…

… now being deprecated

Fixed a few typos in some messages
  • Loading branch information...
1 parent cbbc726 commit 86e2dbff28055837c2c8396ee2c1e63197b68163 @proofek proofek committed Jul 10, 2012
View
6 sonar-php-plugin/src/main/java/org/sonar/plugins/php/phpdepend/PhpDependParserSelector.java
@@ -19,12 +19,13 @@
*/
package org.sonar.plugins.php.phpdepend;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonar.api.BatchExtension;
import org.sonar.api.utils.SonarException;
import static org.sonar.plugins.php.phpdepend.PhpDependConfiguration.PDEPEND_REPORT_TYPE_PHPUNIT;
import static org.sonar.plugins.php.phpdepend.PhpDependConfiguration.PDEPEND_REPORT_TYPE_SUMMARY;
-
/**
* Parser selector for Php Depend. Depending on the option set, different type of files will be parsed.
* As of now choice will be either phpunit-xml or summary-xml
@@ -34,6 +35,7 @@
private PhpDependPhpUnitReportParser phpunitParser;
private PhpDependSummaryReportParser summaryParser;
private PhpDependConfiguration config;
+ private static final Logger LOG = LoggerFactory.getLogger(PhpDependParserSelector.class);
/**
* @param phpunitParser Parser for Php Depend phpunit-xml report
@@ -49,13 +51,13 @@ public PhpDependParserSelector(PhpDependPhpUnitReportParser phpunitParser, PhpDe
/**
* Selects appropriate parser depending on configuration option
*
- * @param config Php Depend Configuration
* @return PhpDependResultsParser
* @throws SonarException
*/
public PhpDependResultsParser select() {
String reportType = config.getReportType();
if (PDEPEND_REPORT_TYPE_PHPUNIT.equals(reportType)) {
+ LOG.info("WARNING: Using deprecated format of PHP Depend report. Support for phpunit-xml report will be removed soon.");
return phpunitParser;
} else if (PDEPEND_REPORT_TYPE_SUMMARY.equals(reportType)) {
return summaryParser;
View
8 sonar-php-plugin/src/main/java/org/sonar/plugins/php/phpdepend/PhpDependSensor.java
@@ -49,7 +49,7 @@
import static org.sonar.plugins.php.phpdepend.PhpDependConfiguration.PDEPEND_WITHOUT_ANNOTATION_KEY;
/**
- * This class is in charge of knowing wether or not it has to be launched depending on a given project. In case it has to be launched, the
+ * This class is in charge of knowing whether or not it has to be launched depending on a given project. In case it has to be launched, the
* sensor, choose between execute phpDepend and analyze its result or only analyze its result
*/
@Properties({
@@ -75,11 +75,11 @@
description = "Comma separated string of packages that will be excluded during the parsing process.",
category = PhpDependSensor.CATEGORY_PHP_PHP_DEPEND),
@Property(key = PDEPEND_ARGUMENT_LINE_KEY, defaultValue = "", name = "Additional arguments", project = true, global = true,
- description = "Additionnal parameters that can be passed to PHP Depend tool.", category = PhpDependSensor.CATEGORY_PHP_PHP_DEPEND),
+ description = "Additional parameters that can be passed to PHP Depend tool.", category = PhpDependSensor.CATEGORY_PHP_PHP_DEPEND),
@Property(key = PDEPEND_TIMEOUT_KEY, defaultValue = "" + DEFAULT_TIMEOUT, name = "Timeout", project = true, global = true,
description = "Maximum number of minutes that the execution of the tool should take.", category = PhpDependSensor.CATEGORY_PHP_PHP_DEPEND),
@Property(key = PDEPEND_REPORT_TYPE, defaultValue = PDEPEND_REPORT_TYPE_DEFVALUE, name = "XML report type", project = true, global = true,
- description = "Type of report PHP Depend will generate and Sonar analyse afterwards.", category = PhpDependSensor.CATEGORY_PHP_PHP_DEPEND)
+ description = "Type of report PHP Depend will generate and Sonar analyse afterwards. Valid values: summary-xml, phpunit-xml (deprecated)", category = PhpDependSensor.CATEGORY_PHP_PHP_DEPEND)
})
public class PhpDependSensor implements Sensor {
@@ -116,7 +116,7 @@ public void analyse(Project project, SensorContext context) {
File reportFile = configuration.getReportFile();
parser.parse(reportFile);
} catch (PhpPluginExecutionException e) {
- LOG.error("Error occured while launching PhpDepend", e);
+ LOG.error("Error occurred while launching PhpDepend", e);
}
}
View
2 sonar-php-plugin/src/main/java/org/sonar/plugins/php/phpunit/PhpUnitConfiguration.java
@@ -212,7 +212,7 @@ public String getMainTestClassFilePath() {
// Otherwise return the file in the base directory
File file = new File(getProject().getFileSystem().getBasedir(), mainFileName);
if (!file.exists()) {
- StringBuilder message = new StringBuilder("The specificied main class file cannot be found: ");
+ StringBuilder message = new StringBuilder("The specified main class file cannot be found: ");
message.append(mainFileName).append(". If you don't have a main test file, consider using a phpunit.xml file and do not ");
message.append("use ").append(PHPUNIT_MAIN_TEST_FILE_KEY).append(" property.");
throw new IllegalStateException(message.toString());
View
2 sonar-php-plugin/src/test/java/org/sonar/plugins/php/phpunit/PhpUnitConfigurationTest.java
@@ -141,7 +141,7 @@ public void shouldFailIfMainClassNotFound() throws Exception {
settings.setProperty(PhpUnitConfiguration.PHPUNIT_MAIN_TEST_FILE_KEY, "AllTests.php");
thrown.expect(IllegalStateException.class);
- thrown.expectMessage("The specificied main class file cannot be found: AllTests.php. " +
+ thrown.expectMessage("The specified main class file cannot be found: AllTests.php. " +
"If you don't have a main test file, consider using a phpunit.xml file and do not use sonar.phpUnit.mainTestClass property.");
phpConfig.getMainTestClassFilePath();

0 comments on commit 86e2dbf

Please sign in to comment.