Skip to content

Commit

Permalink
No longer supressing error, swapped @constant() to defined(). Added @…
Browse files Browse the repository at this point in the history
…throws docblocks for all exceptions thrown in the component.
  • Loading branch information
seeruk committed Feb 16, 2015
1 parent f28dc9a commit 39b44c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public function getTargets()
* @param string $method
*
* @return mixed
*
* @throws \RuntimeException
*/
public function getTargetForMethod($method)
{
Expand Down Expand Up @@ -169,12 +171,14 @@ public function setTargets(array $targets)
* @param mixed $target
*
* @return Route
*
* @throws \InvalidArgumentException
*/
public function target($method, $target)
{
$method = strtoupper($method);

if (!@constant("self::$method")) {
if (!defined("self::$method")) {
throw new \InvalidArgumentException(sprintf(
'Invalid request method "%s" specified.',
$method
Expand Down
2 changes: 2 additions & 0 deletions src/Router/RouteMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function match($method, $url, $routes)

/**
* {@inheritDoc}
*
* @throws RuntimeException
*/
protected function compileRoute(Route $route)
{
Expand Down

0 comments on commit 39b44c5

Please sign in to comment.