Php {inheritardoc}的需求是什么?

Php {inheritardoc}的需求是什么?,php,drupal,Php,Drupal,我经常与Drupal和类打交道,有时我会读到如下内容: /** * {@inheritdoc} */ // return the form definition public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('hello_world.custom_salutation'); $form['salutation

我经常与Drupal和类打交道,有时我会读到如下内容:

/**
  * {@inheritdoc}
  */

  // return the form definition
  public function buildForm(array $form, FormStateInterface $form_state) {
    $config = $this->config('hello_world.custom_salutation');

    $form['salutation'] = array(
      '#type' => 'textfield',
      '#title' => $this->t('Salutation'),
      '#description' => $this->t('Si prega di inserire il saluto che si desidera usare'),
      '#default_value' => $config->get('salutation'),
    );
“继承”是什么意思

这是一种docblock语法,是Drupal的一部分:

您可以在类中使用
{@inheritdoc}

如果要从基重写或实现方法 类或接口,并且文档应该完全相同 作为基类/接口方法


它还指出,这必须是docblock中的唯一一行。

。。。“必须是唯一的一行”。这很烦人,因为您可能想记录一些实现细节。是的,至少能够覆盖它是有用的(尽管从未尝试过,也许他们的意思是“必须是唯一的docblock{}行”,这会更有意义..)