Update grouped endpoint classes to be easier to extend #456
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.
Firstly, I love this package makes generating documentation super simple.
In my application I have a custom built base class that generates the majority of my API endpoints, you just have to extend it and it handles most of the functionality. I've also made it so this base class handles generating the documentation rather than me doing it from the controllers. All of this is outside of the scope of scribe so I'd extended some of the base classes and made changes for my use case.
I had this working with v1 of scribe, but I've had to update to v3 as we're upgrading to PHP 8.1. I've got this working now with version 3 by extending some of the classes, however in scribe they're created by doing
new [class name]
. This pull request changes them to use methods to create the classes to make the package more extendable. Without this I'm having to copy and paste code out of the GroupedEndpointsFromApp class as a bunch of the methods are private.