Passed
Push — develop ( 319bd8...330c7a )
by Neill
16:41 queued 15s
created

Ide::getComponentDetails()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * @link http://www.newicon.net/neon
4
 * @copyright Copyright (c) 2016 Newicon Ltd
5
 * @license http://www.newicon.net/neon/license
6
 */
7
8
namespace neon\core\form\fields;
9
10
use neon\core\form\fields\Field;
11
use neon\core\helpers\Html;
12
13
/**
14
 * Class Text
15
 * @package neon\core\form
16
 */
17
class Ide extends Field
18
{
19
	/**
20
	 * @inheritdoc
21
	 */
22
	public $ddsDataType = 'textlong';
23
24
	/**
25
	 * Array (js object) of editor config options
26
	 * @see https://github.com/ajaxorg/ace/wiki/Configuring-Ace
27
	 * @var array
28
	 */
29
	public $editorOptions = [];
30
31
	/**
32
	 * @inheritdoc
33
	 */
34
	public function getProperties()
35
	{
36
		return array_merge(parent::getProperties(), ["editorOptions"]);
37
	}
38
39
	/**
40
	 * @inheritdoc
41
	 */
42
	public function getValue()
43
	{
44
		// return sanitised data only
45
		return $this->getUnsafeValue();
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->getUnsafeValue() targeting neon\core\form\fields\Field::getUnsafeValue() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
46
	}
47
48
	/**
49
	 * Register scripts
50
	 * @param \neon\core\web\View $view
51
	 */
52
	public function registerScripts($view)
53
	{
54
		$view->registerJsFile("//cdnjs.cloudflare.com/ajax/libs/ace/1.2.8/ace.js", ['concatenate' => 'false']);
55
	}
56
57
	/**
58
	 * @inheritdoc
59
	 */
60
	public function getComponentDetails()
61
	{
62
		return [
63
			'icon' => 'fa fa-paragraph',
64
			'group' => 'Formatted Text',
65
			'order' => 240,
66
			'label' => 'IDE',
67
		];
68
	}
69
}
70