Passed
Push — develop ( 29faa4...07e7ff )
by Neill
33:04 queued 19:04
created
neon/core/form/fields/MaskedInput.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 	/**
36 36
 	 * @inheritdoc
37 37
 	 */
38
-	public function processAsFilter(IQuery $query, $searchData=null)
38
+	public function processAsFilter(IQuery $query, $searchData = null)
39 39
 	{
40 40
 		$searchData = ($searchData === null) ? $this->getValue() : $searchData;
41 41
 		if (!empty($searchData)) {
Please login to merge, or discard this patch.
neon/core/form/fields/FileMultiple.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@
 block discarded – undo
35 35
 	/**
36 36
 	 * @inheritdoc
37 37
 	 */
38
-	public function getValueDisplay($context='')
38
+	public function getValueDisplay($context = '')
39 39
 	{
40 40
 		if (empty($this->value))
41 41
 			return Html::encodeEntities($this->value);
42 42
 		$display = [];
43 43
 		foreach ($this->value as $file)
44 44
 			$display[] = Html::a(neon()->firefly->getFileName($file), neon()->firefly->getUrl($file), ['target' => '_blank']);
45
-		return implode(', <br>',$display);
45
+		return implode(', <br>', $display);
46 46
 	}
47 47
 
48 48
 	/**
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,11 +37,13 @@
 block discarded – undo
37 37
 	 */
38 38
 	public function getValueDisplay($context='')
39 39
 	{
40
-		if (empty($this->value))
41
-			return Html::encodeEntities($this->value);
40
+		if (empty($this->value)) {
41
+					return Html::encodeEntities($this->value);
42
+		}
42 43
 		$display = [];
43
-		foreach ($this->value as $file)
44
-			$display[] = Html::a(neon()->firefly->getFileName($file), neon()->firefly->getUrl($file), ['target' => '_blank']);
44
+		foreach ($this->value as $file) {
45
+					$display[] = Html::a(neon()->firefly->getFileName($file), neon()->firefly->getUrl($file), ['target' => '_blank']);
46
+		}
45 47
 		return implode(', <br>',$display);
46 48
 	}
47 49
 
Please login to merge, or discard this patch.
neon/core/form/fields/Password.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	/**
50 50
 	 * @inheritdoc
51 51
 	 */
52
-	public function processAsFilter(IQuery $query, $searchData=null)
52
+	public function processAsFilter(IQuery $query, $searchData = null)
53 53
 	{
54 54
 		// cannot search as a filter
55 55
 	}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	/**
58 58
 	 * @inheritdoc
59 59
 	 */
60
-	public function getValueDisplay($context='')
60
+	public function getValueDisplay($context = '')
61 61
 	{
62 62
 		return '************';
63 63
 	}
Please login to merge, or discard this patch.
neon/core/form/fields/FileBrowser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getFieldHtml()
42 42
 	{
43
-		return "<div id=\"{$this->getId()}\">" .
44
-			"<firefly-form-file-browser value=\"{$this->value}\" name=\"{$this->getInputName()}\"></firefly-form-file-browser>" .
43
+		return "<div id=\"{$this->getId()}\">".
44
+			"<firefly-form-file-browser value=\"{$this->value}\" name=\"{$this->getInputName()}\"></firefly-form-file-browser>".
45 45
 		"</div>";
46 46
 	}
47 47
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public function getData()
61 61
 	{
62 62
 		$name = $this->getInputName();
63
-		if ( neon()->request->hasFile($name) ) {
63
+		if (neon()->request->hasFile($name)) {
64 64
 			$this->value = neon()->request->file($name)->save();
65 65
 		}
66 66
 		return $this->value;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	/**
70 70
 	 * @inheritdoc
71 71
 	 */
72
-	public function getValueDisplay($context='')
72
+	public function getValueDisplay($context = '')
73 73
 	{
74 74
 		return Html::a(neon()->firefly->getFileName($this->value), neon()->firefly->getUrl($this->value), ['target' => '_blank', 'rel' => 'noopener noreferrer']);
75 75
 	}
Please login to merge, or discard this patch.
neon/core/form/fields/ChoiceMultiple.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	/**
30 30
 	 * @inheritDoc
31 31
 	 */
32
-	public function getValueDisplay($context='')
32
+	public function getValueDisplay($context = '')
33 33
 	{
34 34
 		$items = $this->getSelectedItems();
35 35
 		return implode(',', $items);
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 	/**
76 76
 	 * @inheritdoc
77 77
 	 */
78
-	public function processAsFilter(IQuery $query, $searchData=null)
78
+	public function processAsFilter(IQuery $query, $searchData = null)
79 79
 	{
80 80
 		if (isset($searchData[0])) {
81 81
 			$keys = explode(',', $searchData[0]);
82
-			foreach($keys as $key) {
82
+			foreach ($keys as $key) {
83 83
 				if (!empty($key) && $key !== 'null') {
84 84
 					$query->where($this->getDataKey(), 'like', $key);
85 85
 				}
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,8 +41,9 @@  discard block
 block discarded – undo
41 41
 	public function setValueFromDb($value)
42 42
 	{
43 43
 		$items = [];
44
-		foreach ($value as $item)
45
-			$items[] = $item['key'];
44
+		foreach ($value as $item) {
45
+					$items[] = $item['key'];
46
+		}
46 47
 		return parent::setValueFromDb($items);
47 48
 	}
48 49
 
@@ -55,10 +56,12 @@  discard block
 block discarded – undo
55 56
 	public function getSelectedItems()
56 57
 	{
57 58
 		$values = $this->getValue();
58
-		if (!is_array($values))
59
-			$values = [$values];
60
-		if ($this->create === false)
61
-			return Arr::only($this->getItems(), $values);
59
+		if (!is_array($values)) {
60
+					$values = [$values];
61
+		}
62
+		if ($this->create === false) {
63
+					return Arr::only($this->getItems(), $values);
64
+		}
62 65
 		return $values;
63 66
 	}
64 67
 
Please login to merge, or discard this patch.
neon/core/form/fields/Json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	/**
33 33
 	 * @inheritdoc
34 34
 	 */
35
-	public function getValueDisplay($context='')
35
+	public function getValueDisplay($context = '')
36 36
 	{
37 37
 		return neon()->formatter->asJson($this->getValue());
38 38
 	}
Please login to merge, or discard this patch.
neon/core/form/fields/CheckList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 	/**
21 21
 	 * @inheritDoc
22 22
 	 */
23
-	public function getValueDisplay($context='')
23
+	public function getValueDisplay($context = '')
24 24
 	{
25 25
 		$items = $this->getSelectedItems();
26 26
 		return Html::displayAsTags($items);
Please login to merge, or discard this patch.
neon/core/form/fields/Date.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	/**
103 103
 	 * @inheritdoc
104 104
 	 */
105
-	public function processAsFilter(IQuery $query, $searchData=null)
105
+	public function processAsFilter(IQuery $query, $searchData = null)
106 106
 	{
107 107
 		$searchData = ($searchData === null) ? $this->getValue() : $searchData;
108 108
 		if ($searchData !== '') {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	/**
127 127
 	 * @inheritdoc
128 128
 	 */
129
-	public function getValueDisplay($context='')
129
+	public function getValueDisplay($context = '')
130 130
 	{
131 131
 		// the asDate function sets all empty values to 0 meaning it returns a formatted version of 1970-01-01
132 132
 		if (empty($this->getData()))
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,8 +129,9 @@
 block discarded – undo
129 129
 	public function getValueDisplay($context='')
130 130
 	{
131 131
 		// the asDate function sets all empty values to 0 meaning it returns a formatted version of 1970-01-01
132
-		if (empty($this->getData()))
133
-			return neon()->formatter->nullDisplay;
132
+		if (empty($this->getData())) {
133
+					return neon()->formatter->nullDisplay;
134
+		}
134 135
 		return neon()->formatter->asDate($this->getData());
135 136
 	}
136 137
 
Please login to merge, or discard this patch.
neon/core/form/fields/Textarea.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 class Textarea extends Text
20 20
 {
21
-	const TEXT_TRUNCATE_LENGTH=250;
21
+	const TEXT_TRUNCATE_LENGTH = 250;
22 22
 
23 23
 	/**
24 24
 	 * Set some allowable tags for single text fields
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	/**
37 37
 	 * @inheritdoc
38 38
 	 */
39
-	public function getValueDisplay($context='')
39
+	public function getValueDisplay($context = '')
40 40
 	{
41 41
 		$text = parent::getValueDisplay();
42 42
 		if (strlen($text) > self::TEXT_TRUNCATE_LENGTH)
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	/**
58 58
 	 * @inheritdoc
59 59
 	 */
60
-	public function processAsFilter(IQuery $query, $searchData=null)
60
+	public function processAsFilter(IQuery $query, $searchData = null)
61 61
 	{
62 62
 		$searchData = ($searchData === null) ? $this->getValue() : $searchData;
63 63
 		if ($searchData !== '') {
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@
 block discarded – undo
39 39
 	public function getValueDisplay($context='')
40 40
 	{
41 41
 		$text = parent::getValueDisplay();
42
-		if (strlen($text) > self::TEXT_TRUNCATE_LENGTH)
43
-			return substr($text, 0, self::TEXT_TRUNCATE_LENGTH).'...';
42
+		if (strlen($text) > self::TEXT_TRUNCATE_LENGTH) {
43
+					return substr($text, 0, self::TEXT_TRUNCATE_LENGTH).'...';
44
+		}
44 45
 		return $text;
45 46
 	}
46 47
 
Please login to merge, or discard this patch.