Uh oh!
There was an error while loading. Please reload this page.
Setup PHPStan - #1922
Conversation
| message: '#^Variable \$version might not be defined\.$#' | ||
| identifier: variable.undefined | ||
| count: 1 | ||
| path: include/download-instructions/linux-debian-cli-community.php | ||
| - | ||
| message: '#^Variable \$version might not be defined\.$#' | ||
| identifier: variable.undefined | ||
| count: 1 | ||
| path: include/download-instructions/linux-debian-web-community.php |
There was a problem hiding this comment.
one way to get rid of these errors in the future would be declaring variables expected to be passed in from global scope via
<?php/** @var string $version */?>at the top of the files.
alternatively a more aggressive approach could be asserting the variables instead of just making the tooling aware of it using e.g.
<?phpassert(isset($version) && is_string($version));
?>| parameters: | ||
| level: 3 | ||
| paths: | ||
| - . | ||
| fileExtensions: | ||
| - php | ||
| - inc | ||
| excludePaths: | ||
| analyse: | ||
| - vendor/ |
There was a problem hiding this comment.
after getting more used to the project structure I think for now its best to scan all php files, but exclude only the vendor/. that way we don't miss anything.
initially I configured to only scan certain folders, but this would e.g. miss .php files in the repo root.
this may be fine tuned in future PRs of course
markrandall
commented
Jun 13, 2026
I'd be glad to have phpstan in, although FWIW as I'm rewriting pretty much everything I am aiming for level 8. |
staabm
commented
Jun 13, 2026
having it more strict is great to have. but for a start and for all these legacy scripts we need to start somewhere :) |
derickr
left a comment
There was a problem hiding this comment.
I don't mind, but I couldn't see from the PR whether this would start failing things when phpstan finds problems in PR to this repo.
Uh oh!
There was an error while loading. Please reload this page.
derickr
commented
Jun 16, 2026
My fault, but after this (#1929) there are now conflicts in |
staabm
commented
Jun 16, 2026
conflict resovled |
Uh oh!
There was an error while loading. Please reload this page.
adding a minimal PHPStan setup. this is the starting point so iterating on the PHPStan level can be achieved in future PRs.
as requested in #892 (comment)