我想寫以下的phpDocumentor的塊:phpDocumentor的可選參數
/**
* daysBetween
*
* Returns the number of whole working days between start_date and end_date. Working
* days exclude weekends and any dates identified in holidays.
* Use NETWORKDAYS to calculate employee benefits that accrue based on the number of
* days worked during a specific term.
*
* @param DateTime $startDate Start date
* @param DateTime $endDate End date
* @param DateTime $holidays,... Optional series of dates that will be excluded
* @return integer Interval between the dates
*/
public function daysBetween($startDate,$endDate) {
// Shift the mandatory start and end date that are referenced
// in the function definition, to get any optional days
$holidays = func_get_args();
array_shift($holidays);
array_shift($holidays);
$的startDate和結束日期$是強制性的參數,而$假期的所有實例都是可選的...有可能是沒有,定義一個或多個$假期日期。上述定義的phpDocumentor給我
參數$假期,...不能在daysBetween()
找到我相信我也許可以避開這個問題通過修改方法定義
public function daysBetween($startDate,$endDate,$holidays=NULL) {
但這感覺非常糟糕,我不認爲我應該改變我的函數定義以便記錄它。有人有其他建議嗎?
P.S.我使用的
* @param DateTime $holidays,... Optional series of dates that will be excluded
PHPDocumentor2