code: public function toArray()
      {
          $field = self::createField($this->kind);
          return ['name' => $this->name, $this->kind => $field->getType()->encode($this->value, $field)];
      }
docs: {@inheritdoc}