{% extends "base/class.php.twig" %}

{% block file_path %}
Drupal\{{module}}\Entity\Form\{{ entity_class }}DeleteForm.
{% endblock %}

{% block namespace_class %}
namespace Drupal\{{module}}\Entity\Form;
{% endblock %}

{% block use_class %}
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
{% endblock %}

{% block class_declaration %}
/**
 * Provides a form for deleting a {{ entity_class }} entity.
 *
 * @ingroup {{module}}
 */
class {{ entity_class }}DeleteForm extends ContentEntityConfirmFormBase
{% endblock %}

{% block class_methods %}
  /**
   * {@inheritdoc}
   */
  public function getQuestion() {
    return t('Are you sure you want to delete entity %name?', array('%name' => $this->entity->label()));
  }

  /**
   * {@inheritdoc}
   */
  public function getCancelUrl() {
    return new Url('{{ entity_name }}.list');
  }

  /**
   * {@inheritdoc}
   */
  public function getConfirmText() {
    return t('Delete');
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->entity->delete();

    watchdog('content', '@type: deleted %title.', array('@type' => $this->entity->bundle(), '%title' => $this->entity->label()));
    $form_state->setRedirect('{{ entity_name }}.list');
  }
{% endblock %}

{% extends "base/class.php.twig" %}

{% block file_path %}
Drupal\{{module}}\Entity\Form\{{ entity_class }}DeleteForm.
{% endblock %}

{% block namespace_class %}
namespace Drupal\{{module}}\Entity\Form;
{% endblock %}

{% block use_class %}
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
{% endblock %}

{% block class_declaration %}
/**
 * Provides a form for deleting a {{ entity_class }} entity.
 *
 * @ingroup {{module}}
 */
class {{ entity_class }}DeleteForm extends ContentEntityConfirmFormBase
{% endblock %}

{% block class_methods %}
  /**
   * {@inheritdoc}
   */
  public function getQuestion() {
    return t('Are you sure you want to delete entity %name?', array('%name' => $this->entity->label()));
  }

  /**
   * {@inheritdoc}
   */
  public function getCancelUrl() {
    return new Url('{{ entity_name }}.list');
  }

  /**
   * {@inheritdoc}
   */
  public function getConfirmText() {
    return t('Delete');
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->entity->delete();

    watchdog('content', '@type: deleted %title.', array('@type' => $this->entity->bundle(), '%title' => $this->entity->label()));
    $form_state->setRedirectUrl($this->getCancelUrl());
  }
{% endblock %}

Replace method setRedirect with setRedirectUrl
Replace method setRedirect with setRedirectUrl
