knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.59k stars 280 forks source link

Enhancement: Graceful Handling of Missing Controller Classes in GroupedEndpointsFromApp #718

Closed zfhassaan closed 7 months ago

zfhassaan commented 10 months ago

Summary:

This pull request addresses an issue in the GroupedEndpointsFromApp class where an exception was thrown if a route's controller class couldn't be resolved. The existing code was modified to return null in such cases, allowing for a more graceful handling of the situation.

Changes Made:

The following changes have been made in this pull request:

Updated the code to return null if the route's controller class doesn't exist.

Motivation:

The original code was throwing an exception when the route's controller class couldn't be resolved, which could lead to unnecessary disruptions and confusion. By returning null instead of throwing an exception, the code now gracefully handles scenarios where the class is missing, without causing unexpected issues.

Testing:

The modified code has been tested with various route configurations, including cases where the controller class exists and where it doesn't. Unit tests have been added to ensure that the new behavior is correctly implemented and that the expected return values are achieved.

Additional Notes:

No other changes have been made to the codebase apart from the modifications mentioned above.

shalvah commented 9 months ago

Can you update the tests?

zfhassaan commented 9 months ago

Ok.

shalvah commented 7 months ago

Still got failing tests...

zfhassaan commented 7 months ago

I'm occupied in job so dont have time to fix this. I'm closing this for now. Will create a new one later on