From 757e2053162533ed525aff27c9a46affec386b8d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 27 Aug 2023 11:10:42 +0100 Subject: [PATCH] Update SA tools --- .gitattributes | 26 +++++++++++++------------- .github/workflows/static.yml | 24 ++++++++++++++++++++++++ psalm-baseline.xml | 8 ++++++++ psalm.xml | 16 ++++++++++++++++ vendor-bin/php-cs-fixer/composer.json | 2 +- vendor-bin/phpstan/composer.json | 4 ++-- vendor-bin/psalm/composer.json | 9 +++++++++ 7 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 psalm-baseline.xml create mode 100644 psalm.xml create mode 100644 vendor-bin/psalm/composer.json diff --git a/.gitattributes b/.gitattributes index eb549df..687c48f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,13 @@ -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html - -# Ignore all test and documentation with "export-ignore". -/.github export-ignore -/tests export-ignore - -/.editorconfig export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore -/Makefile export-ignore -/phpstan.neon.dist export-ignore -/phpunit.xml.dist export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +/.github/ export-ignore +.gitignore export-ignore +.php-cs-fixer.dist.php export-ignore +/Makefile export-ignore +/phpstan-baseline.neon export-ignore +/phpstan.neon.dist export-ignore +/phpunit.xml.dist export-ignore +/psalm-baseline.xml export-ignore +/psalm.xml export-ignore +/tests/ export-ignore +/vendor-bin/ export-ignore diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 613d5d2..54609c7 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -56,3 +56,27 @@ jobs: - name: Execute PHP CS Fixer run: vendor/bin/php-cs-fixer fix --diff --dry-run + + psalm: + name: Psalm + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + extensions: mbstring, intl + + - name: Download dependencies + run: composer update --no-interaction --no-progress + + - name: Download Psalm + run: composer bin psalm update --no-interaction --no-progress + + - name: Execute Psalm + run: vendor/bin/psalm.phar --no-progress --output-format=github diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 0000000..c2575ec --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,8 @@ + + + + + \preg_last_error_msg() + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..04d8486 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index a33ba1e..ffac55c 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4 || ^8.0", - "friendsofphp/php-cs-fixer": "3.10.0" + "friendsofphp/php-cs-fixer": "3.23.0" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index 668e077..fc48f6d 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -1,8 +1,8 @@ { "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "1.8.2", - "phpstan/phpstan-deprecation-rules": "1.0.0" + "phpstan/phpstan": "1.10.32", + "phpstan/phpstan-deprecation-rules": "1.1.4" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json new file mode 100644 index 0000000..fae19dc --- /dev/null +++ b/vendor-bin/psalm/composer.json @@ -0,0 +1,9 @@ +{ + "require": { + "php": "^7.4 || ^8.0", + "psalm/phar": "5.15.0" + }, + "config": { + "preferred-install": "dist" + } +}