refactor!: require PHP 8.4
Tests / PHP 8.4 (push) Failing after 5m34s

Drop support for PHP 8.3 and lower. The package now declares >=8.4, and CI runs
only on 8.4.

- composer.json: require php >=8.4.
- mago.toml: php-version = "8.4", matching the minimum supported version.
- phpstan.neon: phpVersion 80400.
- Upgrade phpstan/phpstan to ^2.3: 1.x cannot parse `new Foo()->bar()`, which the
  8.4 formatter now emits.
- Fix the type errors PHPStan 2 reports: class-string<static> variance,
  optional array offsets in fromEnvironment, list vs array for PdoConnection::$lru,
  ReflectionClass<Model> docblocks, Repository made covariant in T, and a redundant
  null comparison in validateRelationPath.
- CI: single PHP 8.4 job using the php:8.4-cli container instead of setup-php,
  which failed with a TLS handshake timeout on the runner.

BREAKING CHANGE: PHP 8.4 is now required.
This commit is contained in:
dgarcia committed 2026-11-15 10:58:11 -03:00
1 parent c15015d809
commit 0e756e45c7
20 files changed
+97 -107

No files matched your search

+6 -4
View File
@@ -26,8 +26,8 @@ Si tu memoria sugiere alguno de esos nombres, está obsoleta.
## Entorno local
- PHP: `C:\php8.4\php.exe` (8.4.19). La librería declara `>=8.2`, así que **no** uses sintaxis de
8.3/8.4 (y por eso `(new Foo())->bar()` conserva los paréntesis).
- PHP: `C:\php8.4\php.exe` (8.4.19). La librería declara `>=8.4`, así que toda la sintaxis de 8.4
está disponible y el formatter puede emitir `new Foo()->bar()`.
- `declare(strict_types=1)` en todo archivo.
- Sin `.env` ni base configurada. Los tests unitarios usan `FakeConnection`; la integración
requiere `CAMELIA_TEST_DSN` y se **salta** si falta.
@@ -44,8 +44,10 @@ Nunca mergees con uno en rojo. Orden obligatorio.
`mago.toml` configura formatter, linter y analyzer. Notas que ahorran tiempo:
- **`php-version = "8.2"` en `mago.toml` es obligatorio.** Si se sube a 8.4, `mago fmt` reescribe
`(new X())->m()` como `new X()->m()`, que rompe el soporte declarado de 8.2.
- **`php-version = "8.4"` en `mago.toml` debe coincidir con el mínimo declarado.** El paquete
promete `>=8.4`, así que `mago fmt` puede emitir `new X()->m()`. Si el soporte mínimo bajara,
`php-version` tendría que bajar con él: con 8.4 el formatter elimina los paréntesis de
`(new X())->m()`, sintaxis que no parsea en 8.3 ni inferiores.
- `mago analyze` excluye `tests/`: no carga el autoloader de Composer, así que reportaría
`PHPUnit\Framework\TestCase` como clase inexistente. PHPStan sí cubre los tests.
- `mago-baseline.toml` acepta los hallazgos de `mixed` inherentes a valores que vienen de PDO.