EntityBrowserDeleteForm   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getQuestion() 0 6 1
A getConfirmText() 0 3 1
A getCancelUrl() 0 3 1
A getDeletionMessage() 0 6 1
1
<?php
2
3
namespace Drupal\entity_browser\Form;
4
5
use Drupal\Core\Entity\EntityDeleteForm;
6
use Drupal\Core\Url;
7
8
/**
9
 * Delete confirm form for entity browsers.
10
 */
11
class EntityBrowserDeleteForm extends EntityDeleteForm {
12
13
  /**
14
   * {@inheritdoc}
15
   */
16
  public function getQuestion() {
17
    return $this->t(
18
      'Are you sure you want to delete entity browser %label?',
19
      ['%label' => $this->entity->label()]
20
    );
21
  }
22
23
  /**
24
   * {@inheritdoc}
25
   */
26
  public function getConfirmText() {
27
    return $this->t('Delete Entity Browser');
28
  }
29
30
  /**
31
   * {@inheritdoc}
32
   */
33
  public function getCancelUrl() {
34
    return new Url('entity.entity_browser.collection');
35
  }
36
37
  /**
38
   * {@inheritdoc}
39
   */
40
  protected function getDeletionMessage() {
41
    return $this->t(
42
      'Entity browser %label was deleted.',
43
      ['%label' => $this->entity->label()]
44
    );
45
  }
46
47
}
48