CloseModalCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
namespace Drupal\paragraphs_editor\Ajax;
4
5
use Drupal\Core\Ajax\CloseModalDialogCommand;
6
use Drupal\paragraphs_editor\EditorCommand\CommandContextInterface;
7
8
/**
9
 * Closes an ajax dialog for a specific editor context.
10
 */
11
class CloseModalCommand extends CloseModalDialogCommand {
12
13
  /**
14
   * Creates a CloseModelCommand.
15
   *
16
   * @param \Drupal\paragraphs_editor\EditorCommand\CommandContextInterface $context
17
   *   The context to close the dialog for.
18
   * @param bool $persist
19
   *   (optional) Whether to persist the dialog in the DOM or not.
20
   */
21
  public function __construct(CommandContextInterface $context, $persist = FALSE) {
22
    parent::__construct($persist);
23
    $this->selector = '#paragraphs-ckeditor-modal-' . md5($context->getContextString());
24
  }
25
26
}
27