Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/php-code-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PHP Code Scanning

on:
push:
branches:
- '*' # Trigger on commits to any branch
pull_request:
branches:
- 'master' # Trigger for PRs targeting the 'master' branch

jobs:
phpstan:
runs-on: ubuntu-22.04

steps:
# Check out the code from the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up PHP 7.4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

# Install dependencies (including PHPStan)
- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist

# Run PHPStan with the github error format
- name: Run PHPStan (Errors Only)
run: |
vendor/bin/phpstan --error-format=github --no-progress
continue-on-error: true # Continue even if PHPStan finds warnings

# Check if PHPStan found errors and fail if so
- name: Fail on Errors (if any)
run: |
if grep -q 'ERROR' phpstan.log; then
echo "PHPStan found errors, failing the job!";
exit 1;
fi
continue-on-error: false # This step will fail the job if errors are found
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"phpunit/phpunit": "^7",
"nimut/testing-framework": "^5.0",
"kitodo/presentation": "~v3.3",
"phpstan/phpstan": "^2.1"
"phpstan/phpstan": "^0.12"
},
"replace": {
"typo3-ter/dpf": "self.version"
Expand Down
40 changes: 21 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading