Skip to content
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

Merged
merged 1 commit into from
Oct 20, 2015

Conversation

wdalmut
Copy link
Contributor

@wdalmut wdalmut commented Oct 19, 2015

Just dropped out the matched static method in favor of default
constructor.

@@ -11,6 +11,7 @@
use Penny\Exception\MethodNotAllowed;
use Penny\Exception\RouteNotFound;
use Psr\Http\Message\RequestInterface;
use Penny\Route\RouteInfo;

class Dispatcher
Copy link
Contributor Author

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?

Copy link
Contributor

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_.. :)

Copy link
Contributor Author

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?

Copy link
Contributor

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 return RouterInfo

is it a good idea? :)

Copy link
Contributor Author

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...

@wdalmut wdalmut force-pushed the feature/routeinfo-direct branch from b57712e to 2a5022a Compare October 19, 2015 18:40
@@ -6,27 +6,27 @@
use Exception;
use ReflectionClass;
use FastRoute\Dispatcher as BaseDispatcher;
use FastRoute\Dispatcher as FastRouterDispatcherInterface;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is duplicated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misunderstanding

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove as.

Copy link
Contributor Author

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

Copy link
Contributor

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;

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wdalmut wdalmut force-pushed the feature/routeinfo-direct branch from 2a5022a to efbee42 Compare October 19, 2015 19:55
$routeInfo = new FastPsr7RouteInfo();
$this->assertInstanceOf(RouteInfoInterface::class, $routeInfo);
$routeInfo = new RouteInfo("", function(){}, []);
$this->assertInstanceOf("Penny\Route\RouteInfoInterface", $routeInfo);
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wdalmut wdalmut force-pushed the feature/routeinfo-direct branch 5 times, most recently from 3dad68b to 3685fc2 Compare October 20, 2015 05:16
Just dropped out the `matched` static method in favor of default
constructor.
@wdalmut wdalmut force-pushed the feature/routeinfo-direct branch from 3685fc2 to b636f99 Compare October 20, 2015 05:18
@gianarb gianarb added this to the 0.6.0 milestone Oct 20, 2015
gianarb pushed a commit that referenced this pull request Oct 20, 2015
Drop static RouteInfo matched method
@gianarb gianarb merged commit d2cf62d into pennyphp:master Oct 20, 2015
@gianarb
Copy link
Contributor

gianarb commented Oct 20, 2015

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants