forkcms/library — pull request #2 by dubgeiser (2013-03-11 13:08:48+00:00)
Title: method_exists in favor of is_callable

The exception handler checks if a getName() method is callable on the
handled exception, this goes horribly wrong when dealing with external
libraries where an exception class supports the __call() method,
Twig_Error for instance; is_callable() on an instance of such class will
always return 'true' even though the method is not really defined in the
class...

In the specific case of Twig_Error this results in a
BadMethodCallException being thrown when Spoon's exception handler
wrongly tries to send it the 'getName' message.

Since is_callable() in the exception handler is actually used to check
if a method exists, resorting to the more semantically correct
'method_exists' seems in order.