Upgrade Slim v4, Dotenv v5, and PHPUnit v9#377
Open
KHHH2312 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
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/Responseimports 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) { |
| }; | ||
| }; | ||
| $container['errorHandler'] = $container['phpErrorHandler'] = function ($container) { | ||
| $container['errorHandler'] = $container->set('phpErrorHandler', function ($container) { |
| public static function load(ContainerInterface $container) | ||
| { | ||
| $container['view'] = function (ContainerInterface $container) { | ||
| $container->set('view', function (ContainerInterface $container) { |
| public static function load(ContainerInterface $container) | ||
| { | ||
| $container['db'] = function (ContainerInterface $container) { | ||
| $container->set('db', function (ContainerInterface $container) { |
Comment on lines
+16
to
+17
| $dotEnv = Dotenv::createUnsafeImmutable($baseDir, $dotFile); | ||
| $dotEnv->safeLoad(); |
| with open(filepath, 'w', encoding='utf-8') as f: | ||
| f.write(content) | ||
|
|
||
| src_dir = r"C:\Users\Khalid\Desktop\bounty\DocsApp\src" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.