Following this thread: How to handle functions deprecation in library? I want to find a way to track all calls to the deprecated function so I can make sure I get them all replaced before the function is removed. Given the following PHP methods
/*
@deprecated - just use getBar()
*/
function getFoo(){
return getBar();
}
function getBar(){
return "bar";
}
I came up with the following method of doing so and I'm looking for feedback.
function getFoo(){
try{
throw new Exception("Deprecated function used");
} catch(Exception $e){
//Log the Exception with stack trace
....
// return value as normal
return getBar();
}
}