Returns the actual form array to be built.
Drupal\Core\Entity\EntityFormController::build()
public function form(array $form, array &$form_state, EntityInterface $entity) {
// @todo Exploit the Field API to generate the default widgets for the
// entity properties.
$info = $entity
->entityInfo();
if (!empty($info['fieldable'])) {
field_attach_form($entity
->entityType(), $entity, $form, $form_state, $this
->getFormLangcode($form_state));
}
return $form;
}