Skip to content

Upgrade Slim v4, Dotenv v5, and PHPUnit v9#377

Open
KHHH2312 wants to merge 2 commits into
modxorg:masterfrom
KHHH2312:update-dependencies
Open

Upgrade Slim v4, Dotenv v5, and PHPUnit v9#377
KHHH2312 wants to merge 2 commits into
modxorg:masterfrom
KHHH2312:update-dependencies

Conversation

@KHHH2312
Copy link
Copy Markdown

@KHHH2312 KHHH2312 commented Jun 1, 2026

This PR updates the dependencies as requested in #98. Included are the Dotenv createUnsafeImmutable fixes, PHPUnit 9 assertion fixes, and the bulk PSR-7 Request/Response interface updates.

Copilot AI review requested due to automatic review settings June 1, 2026 14:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the codebase for newer Slim/PSR and PHPUnit APIs, aligning request/response types and container wiring with updated dependencies.

Changes:

  • Replaced deprecated PHPUnit string assertions with assertStringContainsString / assertStringNotContainsString.
  • Migrated Slim Request/Response imports to PSR-7 interfaces across views/middleware/models.
  • Updated DI container registration style ($container[...] = ... to $container->set(...)) and bumped composer dependencies (Slim 4, phpdotenv 5, PHPUnit 9.5).

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Functional/HomepageTest.php Updates deprecated PHPUnit assertions.
tests/Functional/DocTest.php Updates deprecated PHPUnit assertions.
src/Views/Stats/Searches.php Switches to PSR-7 request/response interfaces.
src/Views/Stats/NotFoundRequests.php Switches to PSR-7 request/response interfaces.
src/Views/Search.php Switches to PSR-7 request/response interfaces.
src/Views/NotFound.php Switches to PSR-7 request/response interfaces.
src/Views/Error.php Switches to PSR-7 request/response interfaces.
src/Views/Doc.php Switches to PSR-7 request/response interfaces.
src/Views/Base.php Switches to PSR-7 request/response interfaces.
src/Twig/DocExtensions.php Switches to PSR-7 request interface.
src/Model/PageRequest.php Switches to PSR-7 request interface.
src/Middlewares/RequestMiddleware.php Switches to PSR-7 request/response interfaces.
src/Helpers/SettingsParser.php Updates Dotenv initialization/loading for v5.
src/DocsApp.php Switches to PSR-7 request/response interfaces.
src/Containers/View.php Changes container registration to set().
src/Containers/Services.php Changes service definitions to set().
src/Containers/Logger.php Changes logger definition to set().
src/Containers/ErrorHandlers.php Changes handler definitions to set() (but currently introduces a functional issue).
src/Containers/DB.php Changes DB definition to set().
refactor.py Adds a refactoring helper script used to apply regex replacements.
composer.json Bumps Slim/Dotenv versions and adds PHPUnit and DI dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public static function load(Container $container)
{
$container['notFoundHandler'] = function ($container) {
$container->set('notFoundHandler', function ($container) {
Comment thread src/Containers/ErrorHandlers.php Outdated
};
};
$container['errorHandler'] = $container['phpErrorHandler'] = function ($container) {
$container['errorHandler'] = $container->set('phpErrorHandler', function ($container) {
Comment thread src/Containers/View.php Outdated
public static function load(ContainerInterface $container)
{
$container['view'] = function (ContainerInterface $container) {
$container->set('view', function (ContainerInterface $container) {
Comment thread src/Containers/DB.php Outdated
public static function load(ContainerInterface $container)
{
$container['db'] = function (ContainerInterface $container) {
$container->set('db', function (ContainerInterface $container) {
Comment thread src/Helpers/SettingsParser.php Outdated
Comment on lines +16 to +17
$dotEnv = Dotenv::createUnsafeImmutable($baseDir, $dotFile);
$dotEnv->safeLoad();
Comment thread refactor.py Outdated
with open(filepath, 'w', encoding='utf-8') as f:
f.write(content)

src_dir = r"C:\Users\Khalid\Desktop\bounty\DocsApp\src"
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.

2 participants