Passed
Pull Request — master (#721)
by Florian
03:35
created

TextEditor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 7
c 2
b 1
f 0
dl 0
loc 41
ccs 8
cts 8
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 2
A render() 0 3 1
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
class TextEditor extends InputGroupComponent
6
{
7
    /**
8
     * The Summernote plugin configuration parameters. Array with key => value
9
     * pairs, where the key should be an existing configuration property of
10
     * the plugin.
11
     *
12
     * @var array
13
     */
14
    public $config;
15
16
    /**
17
     * Create a new component instance.
18
     * Note this component requires the 'Summernote' plugin.
19
     * TODO: the append/prepend addon slots are not supported.
20
     *
21
     * @return void
22
     */
23 1
    public function __construct(
24
        $name, $label = null, $size = null, $labelClass = null,
25
        $topClass = null, $disableFeedback = null, $config = []
26
    ) {
27 1
        parent::__construct(
28 1
            $name, $label, $size, $labelClass, $topClass, $disableFeedback
29
        );
30
31 1
        $this->config = is_array($config) ? $config : [];
32
33
        // Setup the default plugin width option.
34
35 1
        $this->config['width'] = $this->config['width'] ?? 'inherit';
36 1
    }
37
38
    /**
39
     * Get the view / contents that represent the component.
40
     *
41
     * @return \Illuminate\View\View|string
42
     */
43 1
    public function render()
44
    {
45 1
        return view('adminlte::components.text-editor');
46
    }
47
}
48