このスレッドをフォローする:ライブラリでの関数の非推奨を処理する方法は?非推奨の関数へのすべての呼び出しを追跡する方法を見つけて、関数が削除される前にすべてが置き換えられることを確認したいと思います。次のPHPメソッドが与えられます
/*
@deprecated - just use getBar()
*/
function getFoo(){
return getBar();
}
function getBar(){
return "bar";
}
次のような方法を思いついたので、フィードバックを求めています。
function getFoo(){
try{
throw new Exception("Deprecated function used");
} catch(Exception $e){
//Log the Exception with stack trace
....
// return value as normal
return getBar();
}
}