-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop static RouteInfo matched method #95
Conversation
@@ -11,6 +11,7 @@ | |||
use Penny\Exception\MethodNotAllowed; | |||
use Penny\Exception\RouteNotFound; | |||
use Psr\Http\Message\RequestInterface; | |||
use Penny\Route\RouteInfo; | |||
|
|||
class Dispatcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a Router
right? Could Router
be a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm IMO this is a Route.. not a Route_r_.. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know... It just return a RouteInfo
there is no dispatch in place, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes sorry.. I confused line.. Yes we can call it Router..
The
Router
dispatches
a request and returnRouterInfo
is it a good idea? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know effectively is a wrapper around FastRouterDispatcherInterface
interface in order... Maybe we can let this as Dispatcher for now...
b57712e
to
2a5022a
Compare
@@ -6,27 +6,27 @@ | |||
use Exception; | |||
use ReflectionClass; | |||
use FastRoute\Dispatcher as BaseDispatcher; | |||
use FastRoute\Dispatcher as FastRouterDispatcherInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misunderstanding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove as
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sadly the class name is already Dispatcher
we have to let as BaseDispatcher
or another name like: DispatcherInterface
if you prefere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can maintain only
use FastRoute\Dispatcher as BaseDispatcher;
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
2a5022a
to
efbee42
Compare
$routeInfo = new FastPsr7RouteInfo(); | ||
$this->assertInstanceOf(RouteInfoInterface::class, $routeInfo); | ||
$routeInfo = new RouteInfo("", function(){}, []); | ||
$this->assertInstanceOf("Penny\Route\RouteInfoInterface", $routeInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quote, and use RouteInfoInterface::class
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
3dad68b
to
3685fc2
Compare
Just dropped out the `matched` static method in favor of default constructor.
3685fc2
to
b636f99
Compare
Drop static RouteInfo matched method
Thanks 👍 |
Just dropped out the
matched
static method in favor of defaultconstructor.