クラスがあるとしましょう
class View implements ViewInterface, TemplateInterface {
private $template;
public function setTemplate($template) {
$this->template = $template;
return $this;
}
}
その後、ドキュメントを作成TemplateInterface
してsetTemplate($template)
メソッドに到達するとき、その戻り値の型として何を入力しますか?
View
戻り値の型として配置し、後で型TemplateInterface
ではない を実装する別のクラスを作成したView
場合、API ドキュメントが間違っている可能性があります。
View
、ViewInterface
、TemplateInterface
、またはそれらの混合の戻り値の型を書き留めますか?
namespace Views\Interfaces;
interface TemplateInterface {
/* --------------------------------- */
public function getTemplate();
/* ---------------------------------
* @args: void
*
* @return: String - The name of the template.
*/
/* ------------------------------------------ */
public function setTemplate($template);
/* ------------------------------------------
* @arg 1: (String $template) - The name of the template file.
*
* @return: Not sure yet!!!
*/
}