JWysiwyg::fill()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
/**
3
 * @author Sergii Bondarenko, <[email protected]>
4
 */
5
namespace Drupal\TqExtension\Utils\Wysiwyg;
6
7
// Contexts.
8
use Drupal\TqExtension\Context\RawTqContext;
9
10
class JWysiwyg extends Wysiwyg
11
{
12
    public function __construct(RawTqContext $context)
13
    {
14
        $this->setContext($context);
15
        $this->setObject("jQuery('#%s')");
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function fill($text, $selector = '')
22
    {
23
        $this->execute('wysiwyg', $selector, ['setContent', $text]);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function type($text, $selector = '')
30
    {
31
        $this->execute('wysiwyg', $selector, ['insertHtml', $text]);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function read($selector = '')
38
    {
39
        return $this->execute('wysiwyg', $selector, ['getContent']);
40
    }
41
}
42