SummernoteField   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A withUploadUrl() 0 3 1
A withHeight() 0 3 1
A uploadUrl() 0 3 1
A height() 0 3 1
1
<?php
2
3
namespace ArgentCrusade\Forms\Fields;
4
5
use ArgentCrusade\Forms\FormField;
6
7
class SummernoteField extends FormField
8
{
9
    const DEFAULT_HEIGHT = 150;
10
11
    protected $type = 'summernote';
12
13
    /**
14
     * Set editor height.
15
     *
16
     * @param int $height
17
     *
18
     * @return SummernoteField
19
     */
20
    public function withHeight(int $height)
21
    {
22
        return $this->withParameter('height', $height);
23
    }
24
25
    /**
26
     * Get editor height.
27
     *
28
     * @return int
29
     */
30
    public function height()
31
    {
32
        return $this->getParameter('height', static::DEFAULT_HEIGHT);
33
    }
34
35
    /**
36
     * Set upload URL.
37
     *
38
     * @param string $url
39
     *
40
     * @return SummernoteField
41
     */
42
    public function withUploadUrl(string $url)
43
    {
44
        return $this->withParameter('upload_url', $url);
45
    }
46
47
    /**
48
     * Get upload URL.
49
     *
50
     * @return string|null
51
     */
52
    public function uploadUrl()
53
    {
54
        return $this->getParameter('upload_url');
55
    }
56
}
57