Mixing the assignment into the method_exists() call like that makes the code quite hard to read.  Can we break it out to a separate $method = line and then the if() statement?  That would improve readability considerably.