chriso/klein.php — pull request #177 by BaylorRae (2014-01-22 19:26:57+00:00)
Title: Selectively pass parameters to callback

With the current implementation, the only way to access variables like `$matched` or `$response` is to include all the proceeding parameters.

For example, in issue #166, to use `$matched` the callback had to be defined like so.

```php
$klein->respond(function($request, $response, $service, $app, $matched) {
if ($matched > 0) {
// We must have matched a route earlier
} else {
// I guess we didn't match anything earlier, let's go home...
}
});
```

This pull request allows parameters to be defined in any order and Klein will "magically" assign them.

For instance

```php
$klein->respond(function($matched) {
if ($matched > 0) {
// We must have matched a route earlier
} else {
// I guess we didn't match anything earlier, let's go home...
}
});
```