Skip to content

Upgrade Slim, phpdotenv, and PHPUnit#376

Open
radiantjade wants to merge 1 commit into
modxorg:masterfrom
radiantjade:upgrade-php-dependencies
Open

Upgrade Slim, phpdotenv, and PHPUnit#376
radiantjade wants to merge 1 commit into
modxorg:masterfrom
radiantjade:upgrade-php-dependencies

Conversation

@radiantjade
Copy link
Copy Markdown

Summary

  • Upgrade Slim to 4.15.1 with Slim PSR-7, plus Slim view packages for the Slim 4 runtime.
  • Upgrade phpdotenv to 5.6.3 and switch to unsafe immutable loading so existing getenv()-based configuration keeps working.
  • Add PHPUnit 9.6 as a dev dependency and update the functional test harness to PSR-7 requests.
  • Replace Slim 3 container/error/request APIs with a small PSR-11 container, Slim 4 error middleware, and PSR-7 response handling.
  • Preserve existing Twig templates by keeping a path_for compatibility function backed by Slim 4's route parser.

Resolves #98.

Verification

  • composer validate --strict
  • php docs.php sources:init
  • composer test
  • find src tests public -name '*.php' -print0 | xargs -0 -n1 php -l

Notes

  • Docker verification was not available locally because the Docker daemon was not running, so I verified with Homebrew PHP 8.5.6 and Composer 2.9.8.
  • composer audit now only reports the existing league/commonmark 1.x advisories. I left that major migration out of this PR because its renderer API changed substantially and it is separate from the Slim/dotenv/PHPUnit upgrade requested here.

Slim 4 removes the old Slim container, request, response, and error handler APIs, so the app now uses PSR-7/PSR-11 primitives and a small local container while keeping the existing route names and Twig path_for helper stable. phpdotenv and PHPUnit were upgraded at the same time so dependency resolution and the functional tests run on the modern stack.

Constraint: Issue modxorg#98 requests Slim, phpdotenv, and PHPUnit major upgrades with code changes for breaking APIs

Constraint: Docker daemon was unavailable locally, so verification used Homebrew PHP 8.5 with sources:init-provisioned docs

Rejected: Keep Slim 3 compatibility wrappers | would leave the requested Slim 4 migration incomplete

Rejected: Migrate league/commonmark to 2.x in this PR | separate renderer API migration beyond the requested dependency set

Confidence: medium

Scope-risk: moderate

Directive: Do not remove the path_for Twig compatibility function until templates are migrated to Slim 4 url_for naming

Tested: composer validate --strict; composer test; php -l over src tests public

Not-tested: Docker compose install/test path because the local Docker daemon was not running
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.

[€50 bounty] Updating PHP dependencies: Slim, dotenv, phpunit

1 participant