Skip to content

Support checking for named routes (RouteCollector::hasRoute($name))#25

Merged
mrjgreen merged 1 commit intomrjgreen:masterfrom
pascalhofmann:master
May 8, 2015
Merged

Support checking for named routes (RouteCollector::hasRoute($name))#25
mrjgreen merged 1 commit intomrjgreen:masterfrom
pascalhofmann:master

Conversation

@pascalhofmann
Copy link
Copy Markdown
Contributor

There's no way to check whether a named route exists. If called with an unknown route name, RouteCollector::route(…) produces a notice and a warning.

This PR adds a method hasRoute($name).

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) to 99.65% when pulling df56a0b on pascalhofmann:master into 120e576 on mrjgreen:master.

mrjgreen added a commit that referenced this pull request May 8, 2015
Support checking for named routes (RouteCollector::hasRoute($name))
@mrjgreen mrjgreen merged commit 02aab9f into mrjgreen:master May 8, 2015
@mrjgreen
Copy link
Copy Markdown
Owner

mrjgreen commented May 8, 2015

Nice! Thanks for this.

@mrjgreen
Copy link
Copy Markdown
Owner

mrjgreen commented May 8, 2015

May be nice to actually throw an exception in the RouteCollector::route() method if the named route doesn't exist, rather than allowing a notice to be raised.

@DaGhostman
Copy link
Copy Markdown
Contributor

👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants