Conversation
…workflow matrix, and add integration tests.
There was a problem hiding this comment.
Pull request overview
This PR refactors how interface-union types are generated by introducing a token-based PHP parser for extracting class metadata (namespace/class/extends/implements/imports), adds fixtures and tests around edge cases (aliases, grouped uses, inheritance, long declarations), and updates development/CI tooling.
Changes:
- Add a parser in
BaseCommandto extract class info from PHP source and update interface-union generation to use it (including inherited-interface detection). - Expand PHPUnit coverage with workbench fixtures and parser-focused tests for imports/aliases/grouped uses/extends and chunk-boundary reading.
- Update Docker image dependencies and narrow the GitHub Actions Laravel matrix.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| workbench/app/Models/SomeLongClassNameThatCrossesTheLegacyChunkBoundary.php | Fixture for chunk-boundary declaration parsing |
| workbench/app/Models/ParentAnimal.php | Fixture for inheritance chain |
| workbench/app/Models/InheritedAnimal.php | Fixture for extends parsing |
| workbench/app/Models/GroupedUseAnimal.php | Fixture for grouped use + multiple interfaces |
| workbench/app/Models/FullyQualifiedAnimal.php | Fixture for fully-qualified implements |
| workbench/app/Models/AliasAnimal.php | Fixture for aliased imports |
| workbench/app/Interfaces/CompanionInterface.php | Additional interface fixture for grouped import test |
| tests/TestableGenerateInterfaceUnionsCommand.php | Test helper exposing parser method |
| tests/TestCase.php | Import formatting cleanup |
| tests/Commands/GenerateInterfaceUnionsCommandTest.php | New/updated tests for command output and parser behavior |
| src/Commands/GenerateInterfaceUnionsCommand.php | Switch to parsed class info + inheritance traversal instead of is_subclass_of |
| src/Commands/GenerateFormRequestsCommand.php | Formatting/brace cleanup (no functional change apparent) |
| src/Commands/BaseCommand.php | Add class-declaration reader + token parser for namespace/imports/extends/implements |
| Dockerfile | Add SimpleXML build deps and default Laravel version |
| .github/workflows/php-test.yaml | Reduce Laravel test matrix versions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…te dependencies, and add new tests for edge cases.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…extend functionality, update parsing logic in `BaseCommand`, and add tests for new attribute handling.
edenchazard
left a comment
There was a problem hiding this comment.
If you're positive it works then sure 👍 Looks like it tries to compensate for edge cases where the boundary of namespace, class or implements, crosses two batches of tokens.
| /** | ||
| * Padding: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 | ||
| */ |
There was a problem hiding this comment.
I robotted most of it. 😬
There was a problem hiding this comment.
I could tell lol
But this does make sense, you're adding excess to artificially force the edge case you ran into.
There was a problem hiding this comment.
I'll smash it in then. 🙏
🤷