Skip to content

Commit

Permalink
Merge pull request 'feature: removed phpcpd, introduced PHPStan' (#1)…
Browse files Browse the repository at this point in the history
… from introduce_phpstan into develop

Reviewed-on: https://lab.sdo.sh/SDO/Seafile-PHP-SDK/pulls/1
  • Loading branch information
Rene Schmidt committed Jun 11, 2024
2 parents ef634c6 + 6155cd2 commit 5b87276
Show file tree
Hide file tree
Showing 5 changed files with 592 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .forgejo/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: https://github.com/shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo # Add your extensions here.
Expand All @@ -23,7 +23,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: https://github.com/actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
23 changes: 2 additions & 21 deletions bin/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,5 @@

mkdir -p ./build/logs

file=/tmp/psr-2-rsd_ruleset_`date +"%d"`.xml
url=https://raw.githubusercontent.com/rene-s/psr-2-rsd/master/psr-2-rsd_ruleset.xml
size=`stat --printf="%s" $file 2>/dev/null`

if [ ! -f $file ] || [ $size -eq 0 ]; then
wget $url -O $file
fi

if [ -f $file ]; then
./vendor/bin/phpcs \
--report=checkstyle \
--report-file=./build/logs/checkstyle.xml \
--standard=./build/phpcs.xml \
-v ./src ./test \
--ignore=./test/bootstrap.php \
--ignore=./test/ui \
--standard=$file
fi

./vendor/bin/phpcpd ./src ./test --exclude=./test/ui
./vendor/bin/phpunit --log-junit ./build/logs/junit.xml test
./vendor/bin/phpstan analyse --configuration phpstan.neon src test
./vendor/bin/phpunit --log-junit ./build/logs/junit.xml test
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"require-dev": {
"monolog/monolog": " ~2.9",
"phpunit/phpunit": "~9.6",
"sebastian/phpcpd": "~6.0",
"squizlabs/php_codesniffer": "~3.7",
"phpunit/php-timer": "~5.0",
"fzaninotto/faker": "~1.5"
"fzaninotto/faker": "~1.5",
"phpstan/phpstan": "^1.11"
},
"type": "library",
"autoload": {
Expand Down
Loading

0 comments on commit 5b87276

Please sign in to comment.