chore: 🔧 update to work with phpstan

This commit is contained in:
Michel Roux 2025-02-15 20:14:44 +01:00
parent 3114de7fd5
commit c12bcf7b5a
6 changed files with 21 additions and 64 deletions

View File

@ -24,7 +24,7 @@ jobs:
- run: composer install
- run: composer run lint
- run: composer run cs:check
- run: composer run psalm
- run: composer run phpstan
nodejs:
runs-on: ubuntu-latest

View File

@ -84,42 +84,14 @@ appstore:
rm -rf $(appstore_build_directory)
mkdir -p $(appstore_build_directory)
tar -C .. -cvzf $(appstore_package_name).tar.gz \
--exclude="$(app_name)/build" \
--exclude="$(app_name)/tests" \
--exclude="$(app_name)/Makefile" \
--exclude="$(app_name)/*.log" \
--exclude="$(app_name)/phpunit*xml" \
--exclude="$(app_name)/composer.*" \
--exclude="$(app_name)/node_modules" \
--exclude="$(app_name)/js/node_modules" \
--exclude="$(app_name)/js/tests" \
--exclude="$(app_name)/js/test" \
--exclude="$(app_name)/js/*.log" \
--exclude="$(app_name)/js/package.json" \
--exclude="$(app_name)/js/bower.json" \
--exclude="$(app_name)/js/karma.*" \
--exclude="$(app_name)/js/protractor.*" \
--exclude="$(app_name)/package.json" \
--exclude="$(app_name)/bower.json" \
--exclude="$(app_name)/karma.*" \
--exclude="$(app_name)/protractor\.*" \
--exclude="$(app_name)/.*" \
--exclude="$(app_name)/js/.*" \
--exclude="$(app_name)/tsconfig.json" \
--exclude="$(app_name)/stylelint.config.cjs" \
--exclude="$(app_name)/README.md" \
--exclude="$(app_name)/package-lock.json" \
--exclude="$(app_name)/LICENSE" \
--exclude="$(app_name)/src" \
--exclude="$(app_name)/stubs" \
--exclude="$(app_name)/screens" \
--exclude="$(app_name)/vendor" \
--exclude="$(app_name)/translationfiles" \
--exclude="$(app_name)/Dockerfile" \
--exclude="$(app_name)/psalm.xml" \
--exclude="$(app_name)/renovate.json" \
--exclude="$(app_name)/vite.config.ts" \
$(app_name)
$(app_name)/appinfo \
$(app_name)/css \
$(app_name)/img \
$(app_name)/js \
$(app_name)/l10n \
$(app_name)/lib \
$(app_name)/templates \
$(app_name)/CHANGELOG.md
# Start a nextcloud server on Docker to kickstart developement
.PHONY: dev

View File

@ -18,25 +18,25 @@
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"psalm": "psalm --threads=1 --no-cache --show-info=true",
"phpstan": "phpstan clear-result-cache && phpstan analyse -c phpstan.neon",
"rector": "rector && composer cs:fix"
},
"require": {
"php": "~8.1.17"
"php": "^8.1"
},
"require-dev": {
"nextcloud/ocp": "^30.0.6",
"roave/security-advisories": "dev-latest",
"nextcloud/coding-standard": "^1.3.2",
"nextcloud/rector": "^0.3.1",
"rector/rector": "~1.2.10",
"vimeo/psalm": "^6.5.1"
"phpstan/phpstan": "~1.12.18",
"rector/rector": "~1.2.10"
},
"config": {
"optimize-autoloader": true,
"sort-packages": true,
"platform": {
"php": "8.1.17"
"php": "8.1"
}
}
}

View File

@ -34,7 +34,7 @@
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"typescript": "~5.5.4",
"vue-tsc": "^2.2.0"
"vue-tsc": "^2.2.2"
},
"prettier": "@nextcloud/prettier-config"
}

6
phpstan.neon Normal file
View File

@ -0,0 +1,6 @@
parameters:
level: 9
paths:
- lib
ignoreErrors:
- '#Method [a-zA-Z0-9:\(\)\\_]+ return type with generic class OCP\\AppFramework\\Http\\[a-zA-Z]+ does not specify its types#'

View File

@ -1,21 +0,0 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="false"
phpVersion="8.1"
>
<projectFiles>
<directory name="lib" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<extraFiles>
<directory name="vendor"/>
</extraFiles>
</psalm>