skipperbent / simple-php-router

Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.
631 stars 116 forks source link

Fixed the php-di integration example in the README #682

Closed ms-afk closed 8 months ago

ms-afk commented 10 months ago

I've adapted the example to be similar to the current version of Pecee\SimpleRouter\ClassLoader\ClassLoader. That includes returning strings from loadClassMethod and loadClosure and not wrapping every exception, thrown by the called functions, into NotFoundHttpException exceptions, as well as using the exception ClassNotFoundHttpException when a class cannot be found, instead of the generic NotFoundHttpException (that was not even being imported in the previous version). I also changed the way the ClassLoader checks if the container can resolve the class by using the container's method "has" instead of the php function class_exists.

skipperbent commented 8 months ago

Nice work!