diff --git a/src/Efficio/Http/Rule.php b/src/Efficio/Http/Rule.php index f441d4e..0eee13f 100644 --- a/src/Efficio/Http/Rule.php +++ b/src/Efficio/Http/Rule.php @@ -129,8 +129,8 @@ public function matches($req) { $match = false; $matches = []; - $uri = $req; $runcheck = true; + $uri = is_string($req) ? $req : ''; if ($req instanceof Request) { $uri = $req->getUri(); diff --git a/src/Efficio/Http/RuleBook.php b/src/Efficio/Http/RuleBook.php index 2412e40..7be6c2c 100644 --- a/src/Efficio/Http/RuleBook.php +++ b/src/Efficio/Http/RuleBook.php @@ -76,6 +76,7 @@ public function all() public function matching($req, $merge = false) { $matching = null; + $matches = []; foreach ($this->rules as & $rule) { list($ok, $matches) = $rule->matches($req);