Update dependency phpstan/phpstan to ^2.2.1

This commit is contained in:
renovate[bot] 2026-05-28 19:49:22 +00:00
parent a97aec49ff
commit 8839e93dba
9 changed files with 179 additions and 33 deletions

View File

@ -1,6 +1,6 @@
{
"require-dev": {
"phpstan/phpstan": "^2.1.56",
"phpstan/phpstan": "^2.2.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-strict-rules": "^2.0.11",
"tomasvotruba/type-coverage": "^2.2.1",

View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "a1a89a5081a183dea0929c9c7692b544",
"content-hash": "3024ee9f22f3fb038c07e374fc056917",
"packages": [],
"packages-dev": [
{
@ -221,11 +221,11 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.56",
"version": "2.2.1",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/93a603c9fc3be8c3c93bbc8d22170ad766685537",
"reference": "93a603c9fc3be8c3c93bbc8d22170ad766685537",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dea9c8f2d25cc849391042b71e429c1a4bf82660",
"reference": "dea9c8f2d25cc849391042b71e429c1a4bf82660",
"shasum": ""
},
"require": {
@ -248,6 +248,17 @@
"license": [
"MIT"
],
"authors": [
{
"name": "Ondřej Mirtes"
},
{
"name": "Markus Staab"
},
{
"name": "Vincent Langlet"
}
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
@ -270,7 +281,7 @@
"type": "github"
}
],
"time": "2026-05-26T17:04:57+00:00"
"time": "2026-05-28T14:44:12+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",

View File

@ -223,12 +223,12 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.56",
"version_normalized": "2.1.56.0",
"version": "2.2.1",
"version_normalized": "2.2.1.0",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/93a603c9fc3be8c3c93bbc8d22170ad766685537",
"reference": "93a603c9fc3be8c3c93bbc8d22170ad766685537",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dea9c8f2d25cc849391042b71e429c1a4bf82660",
"reference": "dea9c8f2d25cc849391042b71e429c1a4bf82660",
"shasum": ""
},
"require": {
@ -237,7 +237,7 @@
"conflict": {
"phpstan/phpstan-shim": "*"
},
"time": "2026-05-26T17:04:57+00:00",
"time": "2026-05-28T14:44:12+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@ -253,6 +253,17 @@
"license": [
"MIT"
],
"authors": [
{
"name": "Ondřej Mirtes"
},
{
"name": "Markus Staab"
},
{
"name": "Vincent Langlet"
}
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",

View File

@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '570a3312f9d37003cc876900261cf7339ccb3404',
'reference' => 'a97aec49ffe9200123d5e9ed148120db1cb2b6e0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '570a3312f9d37003cc876900261cf7339ccb3404',
'reference' => 'a97aec49ffe9200123d5e9ed148120db1cb2b6e0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -47,9 +47,9 @@
'dev_requirement' => true,
),
'phpstan/phpstan' => array(
'pretty_version' => '2.1.56',
'version' => '2.1.56.0',
'reference' => '93a603c9fc3be8c3c93bbc8d22170ad766685537',
'pretty_version' => '2.2.1',
'version' => '2.2.1.0',
'reference' => 'dea9c8f2d25cc849391042b71e429c1a4bf82660',
'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpstan',
'aliases' => array(),

View File

@ -0,0 +1,115 @@
# PHPStan - PHP Static Analysis Tool
## Project Overview
PHPStan finds errors in PHP code without running it. It catches bugs before tests are written, moving PHP closer to compiled languages. This is the **distribution repository** — the compiled PHAR and supporting infrastructure. The actual source code lives at [phpstan/phpstan-src](https://github.com/phpstan/phpstan-src).
- **Website:** https://phpstan.org/
- **Documentation:** https://phpstan.org/user-guide/getting-started
- **API Reference:** https://apiref.phpstan.org/
## Repository Structure
```
├── phpstan # CLI entry point (shell script loading the PHAR)
├── phpstan.phar # Compiled PHAR archive (~26 MB)
├── phpstan.phar.asc # GPG signature for the PHAR
├── bootstrap.php # PHAR autoloader with PHP version polyfills
├── composer.json # Package definition (requires PHP ^7.4|^8.0)
├── .phar-checksum # MD5 + SHA1 checksums for reproducible builds
├── conf/
│ └── bleedingEdge.neon # Bleeding edge configuration profile
├── e2e/ # End-to-end tests (~67 test scenarios)
├── docker/ # Dockerfiles for PHP 8.08.4
├── identifier-extractor/ # Tool to extract error identifiers from rule source code
├── playground-api/ # AWS Lambda API for the online playground (TypeScript)
├── playground-runner/ # AWS Lambda runner for the playground (PHP/Bref)
├── website/ # phpstan.org static site (Eleventy + Vite + TailwindCSS)
└── .github/workflows/ # CI/CD workflows
```
## Key Concepts
### Distribution Model
This repository distributes a pre-built PHAR archive. The source code is in [phpstan/phpstan-src](https://github.com/phpstan/phpstan-src), which is on PHP 8.1+ internally but the PHAR build is downgraded to support PHP 7.4+. The `phpstan` script loads the PHAR and delegates to the bundled binary.
### PHP Version Support
- **This distribution package:** PHP ^7.4|^8.0 (defined in composer.json)
- **phpstan-src internally:** PHP 8.1+ (downgraded during PHAR build)
- **Other extension repositories** (phpstan-strict-rules, phpstan-doctrine, phpstan-symfony, etc.): still support PHP 7.4+
- **E2E tests run on:** PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 (Linux + Windows)
### Bleeding Edge
The `conf/bleedingEdge.neon` configuration enables experimental/strict checks before they become defaults. Users opt in by including this config.
### Error Identifiers
Every PHPStan error has a unique identifier (e.g., `argument.type`, `deadCode.unreachable`). The `identifier-extractor/` tool scans all PHPStan repositories to extract these identifiers, producing JSON used to generate documentation on the website.
## Development
### CI Workflows
Key workflows in `.github/workflows/`:
- **`tests.yml`** — Runs e2e tests on PHP 7.48.5, Linux + Windows. Triggered on changes to `e2e/**`, `phpstan`, `.phar-checksum`, `bootstrap.php`.
- **`other-tests.yml`** — Additional integration tests (PHP-Parser, React Promise, etc.)
- **`integration-tests.yml`** — Tests against major projects (Rector, Larastan, Carbon, etc.)
- **`extension-tests.yml`** — Tests 1st-party PHPStan extensions (PHPUnit, Doctrine, Symfony, etc.)
- **`release.yml`** — Creates GitHub release on tag push, uploads `phpstan.phar` and signature
- **`docker-stable.yml`** / **`docker-nightly.yml`** — Builds multi-arch Docker images (arm64 + amd64) pushed to ghcr.io
- **`extract-identifiers.yml`** — Extracts error identifiers from all PHPStan repos
- **`website.yml`** — Builds and deploys phpstan.org
- **`generate-error-docs.lock.yml`** — Generates error documentation using Claude
### Current Branch
The main development branch for this repository is `2.2.x`.
## Website
The website (phpstan.org) lives in `website/` and has its own `website/CLAUDE.md` with detailed instructions. Key points:
- Built with Eleventy (11ty) + Vite + TailwindCSS
- Two-stage build: `npm run build:11ty` then `npm run build:vite`
- Deployed to AWS S3 + CloudFront
- Error documentation in `website/errors/` is auto-generated (see `website/errors/CLAUDE.md`)
## Playground
The online playground at https://phpstan.org/try consists of two AWS Lambda services:
- **playground-api/** — TypeScript API that orchestrates analysis across multiple PHP versions
- **playground-runner/** — PHP Lambda (via Bref) that executes PHPStan against submitted code
Both are deployed via the Serverless Framework to eu-west-1.
## Docker
Dockerfiles in `docker/` build images for PHP 8.08.4, based on `php:*-cli-alpine`. Images are published to `ghcr.io` as multi-architecture (arm64 + amd64). The images install PHPStan via Composer and use `phpstan` as the entrypoint.
## Related Repositories
- [phpstan/phpstan-src](https://github.com/phpstan/phpstan-src) — Main source code (PHP 8.1+, downgraded for PHAR)
- [phpstan/phpstan-strict-rules](https://github.com/phpstan/phpstan-strict-rules) — Additional strict rules
- [phpstan/phpstan-deprecation-rules](https://github.com/phpstan/phpstan-deprecation-rules) — Deprecation detection
- [phpstan/phpstan-doctrine](https://github.com/phpstan/phpstan-doctrine) — Doctrine integration
- [phpstan/phpstan-symfony](https://github.com/phpstan/phpstan-symfony) — Symfony integration
- [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) — PHPUnit integration
- [phpstan/phpstan-nette](https://github.com/phpstan/phpstan-nette) — Nette integration
- [phpstan/phpstan-webmozart-assert](https://github.com/phpstan/phpstan-webmozart-assert) — Webmozart Assert integration
- [phpstan/phpdoc-parser](https://github.com/phpstan/phpdoc-parser) — PHPDoc parser library
Extension repositories support PHP 7.4+ and some support multiple versions of the libraries they analyse.
## Making Changes
- **Source code changes** belong in [phpstan/phpstan-src](https://github.com/phpstan/phpstan-src), not here
- **E2E tests** can be added or modified in `e2e/`
- **Website content** is in `website/src/` (see `website/CLAUDE.md`)
- **Error documentation** is in `website/errors/` (see `website/errors/CLAUDE.md`)
- Configuration uses NEON format (Nette Object Notation), similar to YAML

View File

@ -67,7 +67,7 @@ Want your logo here? [Learn more »](https://phpstan.org/sponsor)
<br>
<a href="https://zol.fr?utm_source=phpstan"><img src="website/src/images/sponsor/zol.png" alt="ZOL" width="283" height="64"></a>
&nbsp;&nbsp;&nbsp;
<a href="https://www.edgenext.com/"><img src="website/src/images/sponsor/edgenext.png" alt="EdgeNext" width="283" height="64"></a>
<a href="https://inviqa.com/"><img src="website/src/images/sponsor/inviqa.png" alt="Inviqa" width="254" height="65"></a>
<br>
<a href="https://route4me.com/"><img src="website/src/images/sponsor/route4me.png" alt="Route4Me: Route Optimizer and Route Planner Software" width="283" height="64"></a>
&nbsp;&nbsp;&nbsp;
@ -78,10 +78,8 @@ Want your logo here? [Learn more »](https://phpstan.org/sponsor)
<a href="https://www.campoint.net/"><img src="website/src/images/sponsor/campoint.png" alt="campoint AG" width="283" height="64"></a>
<br>
<a href="https://www.crisp.nl/"><img src="website/src/images/sponsor/crisp.png" alt="Crisp.nl" width="283" height="64"></a>
&nbsp;&nbsp;&nbsp;
<a href="https://inviqa.com/"><img src="website/src/images/sponsor/inviqa.png" alt="Inviqa" width="254" height="65"></a>
<br>
<a href="https://www.netrouting.com/"><img src="website/src/images/sponsor/netrouting.png" alt="Netrouting" width="254" height="65"></a>
[**You can sponsor my open-source work on PHPStan through GitHub Sponsors and also directly.**](https://phpstan.org/sponsor)

View File

@ -2,6 +2,17 @@
"name": "phpstan/phpstan",
"description": "PHPStan - PHP Static Analysis Tool",
"license": ["MIT"],
"authors": [
{
"name": "Ondřej Mirtes"
},
{
"name": "Markus Staab"
},
{
"name": "Vincent Langlet"
}
],
"keywords": ["dev", "static analysis"],
"require": {
"php": "^7.4|^8.0"

View File

@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmoV0nsACgkQUcZzBf/C
5cCg9g/+NXlFA76CXI1399Y3bXRuHLLZ0IEadW39coDRb1siXu35PLOA/I9PsfbZ
v8QJretHdZbC+VF+AhRuOyVtEBVzNB+otg+AUzSToFPonwgyItCFnjUHAtJWxa1/
nCcIUpi9Tn6wtNSKgDoIQk88K9AOrfWQsGl0M0rjakpknhwRzTMahkMTt68y1ibO
CoEP5/Qo4AddjsdNekx+0ucG1zSzQviDiRX6/+Me7SUpVYfG5uboOCRlIo9wFgMC
4xvKY5ZcRF11iLZZHSwF+8NnXKcEOvL6Lx8GzCj6QW8GNha/ujKYlPI3ig2XZq8K
rI0SYiMLIZNDoOYSQRCGpuhTeY+BVXLf7ULsgf2sKCaC932K+V7ithU8w69z/R7E
48/HODcW4THe4YM0w+tCVMjf0CfDAzwA7WtlIVnw3TEZSCcMIXXlbyLPqQQn0TOy
FNUPAXwr9jFnYjbPFr8IuksxIRW1NgjCAehqhdTDkDsfcMn3Hjd0lwjyD4SYDI5f
hcJlEn+AM4njrJX5F0mlTXw+HxpHepH95xCpTpln+BdARbaOLmjnlUf/9gUFUnOJ
U07YwYGmg0wm63qT5BE6dxsGBymAUIAbKQCDwG2PD4l5VZh66xkDXUG5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