sveneld opened a new pull request, #3436: URL: https://github.com/apache/thrift/pull/3436
<!-- Explain the changes in the pull request below: --> > **Note:** This PR is **stacked on top of #3435 ([THRIFT-5956](https://github.com/apache/thrift/pull/3435))**. The current diff temporarily includes those changes — once #3435 merges, this branch will be rebased on master and the diff will reduce to just the phpstan-related files. The PHP runtime library at `lib/php/lib/` had no static-analysis tooling in CI. Refactors and upcoming type-modernization PRs would otherwise go in without an automated safety net. **Changes:** - Adds `phpstan/phpstan ^1.12` as a `require-dev` dependency, plus a `scripts.phpstan` composer alias for local dev convenience. - Adds `lib/php/phpstan.neon` (level 1) targeting `lib/php/lib/` with `test/bootstrap.php` for autoload, and a generated `lib/php/phpstan-baseline.neon` that pins the **16 issues** already present in the codebase. These are mostly real findings (e.g. missing `return` statements in `TJSONProtocol::writeStructBegin/End`, possibly-undefined locals in `TBufferedTransport`/`TSocketPool`) — left for follow-up tickets to fix individually. - Adds a new `lib-php-quality` job in `.github/workflows/build.yml` that runs phpstan on PHP 8.3 with `--error-format=github` so any new finding shows up as an inline annotation on the PR diff. Level 1 catches undefined variables and obvious type mismatches without requiring widespread code changes. Higher levels will be raised in follow-up tickets as the runtime library gains native types and PHPDoc cleanup. **Out of scope (separate tickets, in roadmap order):** - PSR-2 → PSR-12 migration / php-cs-fixer. - `declare(strict_types=1)` and native parameter / return / property types in `lib/php/lib/`. - Static analysis of generated PHP under `test/Resources/packages/`. - PHPUnit attribute migration & PHPUnit 10/11 upgrade. - `t_php_generator.cc` modernization. <!-- We recommend you review the checklist/tips before submitting a pull request. --> - [x] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? [THRIFT-5957](https://issues.apache.org/jira/browse/THRIFT-5957) - [x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"? - [x] Did you squash your changes to a single commit? (not required, but preferred) - [x] Did you do your best to avoid breaking changes? *(Pure tooling addition — no behaviour change.)* - [ ] If your change does not involve any code, include `[skip ci]` anywhere in the commit message to free up build resources. <!-- The Contributing Guide at: https://github.com/apache/thrift/blob/master/CONTRIBUTING.md has more details and tips for committing properly. --> Generated-by: Claude Opus 4.7 (1M context) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
