private static function replaceMethod($source, $method) { $newName = self::$methodPrefix . $method; return str_replace("function {$method}(", "function {$newName}(", $source); }