Repository navigation
devops: hold our php to upstream adminer's phpstan bar, strict rules included - #196
Merged
Merged
Conversation
…included Code written next to adminer now meets the checks adminer runs on itself: the same stricter parameters and the same strict rules, pinned as composer dev dependencies so the extension matches phpstan's version.
[High impact] The PR appears safe to merge; no actionable defect was found. SummaryMoves PHPStan into Composer with pinned strict rules and adds the selected upstream checks.
Reviews (1) · Last reviewed commit: "devops: hold our php to upstream adminer..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our PHP now passes the same phpstan checks upstream adminer runs on itself (its
conf/phpstan.neon): the stricter parameters (checkNullables, uninitialized and dynamic properties, callable signatures, thereportMaybes*set) and the same hand-pickedphpstan-strict-rules, withallRules: falseas upstream has it.phpstan-strict-rules2.1.0 like upstream, not a phar the Makefile downloads: the extension has to match phpstan's version, andcomposer.lockpins the pair.phpstan.restarted=1throughPHP_INI_SCAN_DIR. phpstan 2.3 restarts itself throughPHP_BINARY, which is empty under frankenphp'sphp-cli, so the run died with "env: php"; that value is what its own restart sets. An ini file becausephp-clitakes no-d, the same reasonWIN_INIis one.AdminerDesktop::$translationsredeclared the property only to narrow its phpdoc, and phpstan saw the parent asmixed— the compiler strips adminer's doc-comments.phpstan-plugin.stubgives it adminer's own type, so the redeclaration goes.allRules: true: it reports 50 more, nearly all adminer's own idioms our code follows on purpose —==,?:,empty(), non-boolean conditions.make qa,make checkandmake e2e(both drivers) pass.