Skip to content

devops: hold our php to upstream adminer's phpstan bar, strict rules included - #196

Merged
landsman merged 1 commit into
mainfrom
devops/phpstan-strict-rules
Oct 24, 2026
Merged

landsman merged 1 commit into
mainfrom
devops/phpstan-strict-rules

Conversation

@landsman

Copy link
Copy Markdown
Owner

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, the reportMaybes* set) and the same hand-picked phpstan-strict-rules, with allRules: false as upstream has it.

  • phpstan is a composer dev dependency now, pinned to 2.3.1 beside phpstan-strict-rules 2.1.0 like upstream, not a phar the Makefile downloads: the extension has to match phpstan's version, and composer.lock pins the pair.
  • phpstan.restarted=1 through PHP_INI_SCAN_DIR. phpstan 2.3 restarts itself through PHP_BINARY, which is empty under frankenphp's php-cli, so the run died with "env: php"; that value is what its own restart sets. An ini file because php-cli takes no -d, the same reason WIN_INI is one.
  • The one finding: AdminerDesktop::$translations redeclared the property only to narrow its phpdoc, and phpstan saw the parent as mixed — the compiler strips adminer's doc-comments. phpstan-plugin.stub gives it adminer's own type, so the redeclaration goes.
  • Not allRules: true: it reports 50 more, nearly all adminer's own idioms our code follows on purpose — ==, ?:, empty(), non-boolean conditions.

make qa, make check and make e2e (both drivers) pass.

…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.
@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable defect was found.

Summary

Moves PHPStan into Composer with pinned strict rules and adds the selected upstream checks.

  • PHP checks now use pinned PHPStan tools and Adminer’s selected strict rules.
  • AdminerDesktop uses Adminer’s typed translations property.

Reviews (1) · Last reviewed commit: "devops: hold our php to upstream adminer..." · Reviewed by Greptile

@landsman
landsman merged commit e7cae53 into main Oct 24, 2026
7 checks passed
@landsman
landsman deleted the devops/phpstan-strict-rules branch October 24, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant