hoaproject / Dispatcher

The Hoa\Dispatcher library.
https://hoa-project.net/
12 stars 8 forks source link

Error ignoring but still raise an error #1

Closed guiled closed 10 years ago

guiled commented 10 years ago

https://github.com/hoaproject/Dispatcher/blob/master/Basic.php#L83-L88 In these lines, the operator @ prevents to raise errors, but if you put an custom error handler with this code :

set_error_handler(function ($errno, $errstr, $errfile, $errline ) {
    var_dump(func_get_args());
});

There is still an triggered error.

In order to prevent this, I suggest these line as replacement

    $call       = !empty($variables['controller']) ? $variables['controller'] :
                    !empty($variables['_call']) ? $variables['_call'] : $rule[\Hoa\Router::RULE_CALL];
    $able       = !empty($variables['action']) ? $variables['action'] :
                    !empty($variables['_able']) ? $variables['_able'] : $rule[\Hoa\Router::RULE_ABLE];
Hywan commented 10 years ago

Hello :-),

Does it solve your issue 765b3b0d9ecf8dba902a6b780bab7afbcf12d3f4?

guiled commented 10 years ago

Yes it does! Thank you! (sorry for not having made a PR for that, I wasn't sure it would be kind)

Hywan commented 10 years ago

No that's ok :-). Thank you!