Skip to content

Commit 2f77186

Browse files
authored
Merge pull request #4 from WsdlToPhp/feature/add-tools
Add tools to Sonars
2 parents 4ed9655 + 3cf0c3e commit 2f77186

File tree

4 files changed

+60
-12
lines changed

4 files changed

+60
-12
lines changed

.github/workflows/sonars.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Sonars
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- feature/*
7+
- feat/*
8+
- release/*
9+
pull_request:
10+
types: [ opened, synchronize, reopened ]
11+
jobs:
12+
sonarcloud:
13+
name: Sonars
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
statuses: write
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup PHP with Xdebug
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: 7.4
29+
coverage: xdebug
30+
31+
- name: Install dependencies with composer
32+
run: composer update --no-ansi --no-interaction --no-progress
33+
34+
- name: Generate coverage report with phpunit
35+
run: vendor/bin/phpunit --coverage-clover coverage.xml --log-junit report.xml
36+
37+
- name: Monitor coverage
38+
uses: slavcodev/coverage-monitor-action@v1
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
coverage_path: coverage.xml
42+
threshold_alert: 90
43+
threshold_warning: 95
44+
45+
- name: Codecov analyze
46+
uses: codecov/codecov-action@v3
47+
with:
48+
files: coverage.xml
49+
50+
- name: Fix phpunit files paths
51+
run: sed -i 's@'$GITHUB_WORKSPACE/'@''@g' coverage.xml report.xml
52+
53+
- name: SonarCloud Scan
54+
uses: SonarSource/sonarcloud-github-action@master
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.4'
2-
31
services:
42
php:
53
build:

sonar-project.properties

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,5 @@ sonar.organization=wsdltophp
33
sonar.php.coverage.reportPaths=coverage.xml
44
sonar.php.tests.reportPath=report.xml
55

6-
# This is the name and version displayed in the SonarCloud UI.
7-
#sonar.projectName=WsdlHandler
8-
#sonar.projectVersion=1.0
9-
10-
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
11-
#sonar.sources=.
12-
13-
# Encoding of the source code. Default is default system encoding
14-
#sonar.sourceEncoding=UTF-8
6+
sonar.sources=src/
7+
sonar.tests=tests/

src/Wsdl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function useParentMethodAndExternals(string $method, array $parameters
9191
return $result;
9292
}
9393

94-
protected function useExternalSchemas(string $method, array $parameters, $parentResult, bool $returnOne = false)
94+
protected function useExternalSchemas(string $method, array $parameters, ?array $parentResult, bool $returnOne = false)
9595
{
9696
$result = $parentResult;
9797

0 commit comments

Comments
 (0)