| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- removed autoload-dev.classmap - normalize Tests/* namespace to tests - rename tests/server-v2 to tests/server_v2 - remove tests/phpunit_autoload.php - update tests files namespaces - update tests/server/index.php and tests/server_v2/index.php to use composer autoloader - extract tests/server_v2/AuthCheck.php
There was a problem hiding this comment.
This PR modernizes FlightPHP/Core’s bootstrapping by removing the bespoke framework/test autoloaders and standardizing the test tree so everything loads via Composer (PSR-4), with accompanying namespace and path updates.
Changes:
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file| File | Description |
|---|---|
| composer.json | Switches to PSR-4 autoloading (plus classmap for global Flight) and updates test-server script paths. |
| index.php | Uses Composer autoloader instead of directly including flight/Flight.php. |
| flight/Flight.php | Removes framework-level require of the old custom autoloader. |
| flight/core/Loader.php | Improves directory registration (is_iterable) and normalizes directory separators; docblock tweaks. |
| flight/autoload.php | Deleted custom autoloader. |
| phpunit.xml.dist | Removes bootstrap file reference; updates excluded test directory name. |
| tests/phpunit_autoload.php | Deleted custom PHPUnit bootstrap. |
| tests/EventSystemTest.php | Normalizes test namespace to match new autoload-dev PSR-4 mapping. |
| tests/LoaderTest.php | Updates callable registration and replaces helper subclasses with reflection-based assertions. |
| tests/named_arguments/FlightTest.php | Updates namespace to match renamed directory and PSR-4 mapping. |
| tests/named_arguments/ExampleClass.php | Adds namespace for PSR-4 compatibility. |
| tests/server/index.php | Updates middleware class imports and switches to Composer autoload. |
| tests/server/AuthCheck.php | Namespace updated for PSR-4 mapping consistency. |
| tests/server/LayoutMiddleware.php | Namespace updated for PSR-4 mapping consistency. |
| tests/server/OverwriteBodyMiddleware.php | Namespace updated for PSR-4 mapping consistency. |
| tests/server/Pascal_Snake_Case.php | Namespace updated for PSR-4 mapping consistency. |
| tests/server-v2/index.php | Deleted old v2 test server entrypoint. |
| tests/server_v2/index.php | Adds the new v2 test server entrypoint under the normalized directory name. |
| tests/server_v2/AuthCheck.php | Extracts v2 middleware into a PSR-4-loadable class. |
| tests/server_v2/template.phtml | Adds a template file for the v2 test server. |
tests/named_arguments/ExampleClass.php:8
Sorry, something went wrong.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
This one I can't approve and merge. What you have done long term is correct and the right way to go, but because this was setup the way it is, people who have downloaded the zip rely on that autoload.php file for their workflows. Some of the main selling points of Flight is that it is simple and easy to implement, no dependencies, and no breaking changes are introduced to keep it backwards compatible. |
Sorry, something went wrong.
|
so if I restore autoload.php, this PR could be merged? |
Sorry, something went wrong.
|
@copilot resolve the merge conflicts in this pull request |
Sorry, something went wrong.
Merged the latest master into autoload-rework. The merge resolved automatically without any conflicts — composer.json and tests/named_arguments/FlightTest.php were the only files touched by both branches, and both merged cleanly. The branch is now up to date with master. |
Sorry, something went wrong.
|
Yeah that's better! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This pull request refactors the project’s autoloading and test structure to modernize dependency management, standardize naming conventions, and improve test reliability. The most significant changes include removing the custom autoloader in favor of Composer's autoloader, updating namespaces and directory structures for consistency, and cleaning up test and configuration files.
Autoloading and Dependency Management:
Namespace and Directory Structure Standardization:
Test and Configuration Improvements:
Loader and Internal Improvements:
Miscellaneous:
These changes collectively modernize the codebase, improve consistency, and make the project easier to maintain and extend.