php-deprecations-auditlisted
Install: claude install-skill JMAILLY/claude-migration-skills
# PHP & Drupal deprecations audit (before a major core bump)
> ⚠️ **RUN WHILE CORE IS STILL ON THE OLD MAJOR (e.g. Drupal 10).**
> Upgrade Status and drupal-rector derive their target from the installed core.
> On D10 they surface/fix "deprecated in D10, removed in D11" — exactly what we
> want. If core is already on D11 they switch to the D12 target and the D11
> correction list becomes unreachable. Fix everything and re-scan until 0 errors
> for the target major BEFORE bumping core.
## Golden rule: everything goes through the Makefile
Never call `drush`, `composer` or `php` directly on the host — use `make`:
| Need | Make target |
|---|---|
| Generic Drush command | `make drush c='<cmd>'` |
| Add a dev dependency | `make composer-require <pkg> --dev` |
| Static analysis | `make phpstan` |
| Coding-standards fix | `make phpcbf` |
| Shell in the PHP container | `make shell` |
| Enable a module | `make en <m>` |
For tools that must run inside the container (rector, `php -v`…), use
`make shell` and execute from within.
## Main tool: Upgrade Status
`drupal/upgrade_status` scans custom and contrib code for deprecated APIs and
next-major incompatibilities.
```bash
make composer-require drupal/upgrade_status --dev
make en upgrade_status
make drush c='upgrade_status:analyze' # overview
```
Report also at `/admin/reports/upgrade-status`. Target a specific module:
```bash
make drush c='upgrade_status:analyze <custom_module_name>'
make drush c='pml --type=modu