Skip to content

Commit fae44ba

Browse files
committed
Added Sonar Scanner
1 parent 2212f72 commit fae44ba

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ nbproject/private
22
*~
33
composer.lock
44
vendor
5-
.idea
5+
.idea
6+
7+
.scannerwork
8+
phpunit.coverage.xml
9+
phpunit.report.xml
10+

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ php:
66
- "5.6"
77

88
install:
9+
- export SONARSCANNER_VERSION=3.2.0.1227
10+
- wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONARSCANNER_VERSION-linux.zip
11+
- unzip sonar-scanner-cli-$SONARSCANNER_VERSION-linux.zip
912
- composer install
1013

1114
script:
12-
- vendor/bin/phpunit
15+
- vendor/bin/phpunit --coverage-clover phpunit.coverage.xml --log-junit phpunit.report.xml
16+
- sonar-scanner-$SONARSCANNER_VERSION-linux/bin/sonar-scanner -Dsonar.login=$SONAR_LOGIN
1317

sonar-project.properties

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Configuration
2+
sonar.projectKey=SingletonPatternPHP
3+
sonar.organization=byjg-opensource
4+
sonar.host.url=https://sonarcloud.io
5+
sonar.projectVersion=1.0
6+
7+
# Comma-separated paths to directories with sources (required)
8+
sonar.sources=src
9+
sonar.tests=tests
10+
sonar.php.tests.reportPath=phpunit.resport.xml
11+
sonar.php.coverage.reportPath=phpunit.coverage.xml
12+
13+
# Language
14+
#sonar.language=javascript
15+
16+
# Encoding of the source files
17+
sonar.sourceEncoding=UTF-8
18+

0 commit comments

Comments
 (0)