Passed
Push — releases ( 51c2cc...e1d10c )
by steve
39:06 queued 13:38
created
neon/core/form/fields/File.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,9 @@
 block discarded – undo
99 99
 	 */
100 100
 	public function getValueDisplay()
101 101
 	{
102
-		if (empty($this->value))
103
-			return Html::encodeEntities($this->value);
102
+		if (empty($this->value)) {
103
+					return Html::encodeEntities($this->value);
104
+		}
104 105
 		return Html::a(neon()->firefly->getFileName($this->value), neon()->firefly->getUrl($this->value), ['target' => '_blank']);
105 106
 	}
106 107
 
Please login to merge, or discard this patch.
neon/core/form/fields/Choice.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,8 +105,9 @@
 block discarded – undo
105 105
 	public function getItemsDisplay()
106 106
 	{
107 107
 		$items = $this->getItems();
108
-		foreach ($items as $key => $value)
109
-			$items[$key] = '<span class="neonField_labelText">'.$value.'</span>';
108
+		foreach ($items as $key => $value) {
109
+					$items[$key] = '<span class="neonField_labelText">'.$value.'</span>';
110
+		}
110 111
 		return $items;
111 112
 	}
112 113
 
Please login to merge, or discard this patch.
neon/core/form/fields/FileMultiple.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,6 +42,6 @@
 block discarded – undo
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
\ No newline at end of file
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()
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
 }
48 50
\ No newline at end of file
Please login to merge, or discard this patch.
neon/core/form/fields/DateRange.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	/**
91 91
 	 * @inheritdoc
92 92
 	 */
93
-	public function processAsFilter(IQuery $query, $searchData=null)
93
+	public function processAsFilter(IQuery $query, $searchData = null)
94 94
 	{
95 95
 		$searchData = ($searchData === null) ? $this->getData() : $searchData;
96 96
 		if ($searchData !== '') {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	{
127 127
 		$value = parent::getValue();
128 128
 		// the result must be an array with 'from'=> and 'to'=>
129
-		if ( is_array($value) && isset($value['from'], $value['to']) ) {
129
+		if (is_array($value) && isset($value['from'], $value['to'])) {
130 130
 			return [
131 131
 				'from' => $this->_isDateValid($value['from']) ? $value['from'] : '',
132 132
 				'to' => $this->_isDateValid($value['to']) ? $value['to'] : ''
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,10 +96,12 @@
 block discarded – undo
96 96
 		if ($searchData !== '') {
97 97
 			$dateFrom = Arr::get($searchData, 'from');
98 98
 			$dateTo   = Arr::get($searchData, 'to');
99
-			if ($dateFrom)
100
-				$query->where($this->getDataKey(), '>=', $dateFrom);
101
-			if ($dateTo)
102
-				$query->where($this->getDataKey(), '<=', $dateTo);
99
+			if ($dateFrom) {
100
+							$query->where($this->getDataKey(), '>=', $dateFrom);
101
+			}
102
+			if ($dateTo) {
103
+							$query->where($this->getDataKey(), '<=', $dateTo);
104
+			}
103 105
 		}
104 106
 	}
105 107
 
Please login to merge, or discard this patch.
neon/core/form/fields/SelectDynamic.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * Any filters you want to apply to a data map selection.
64 64
 	 * @var array  field=>value
65 65
 	 */
66
-	public $dataMapFilters=[];
66
+	public $dataMapFilters = [];
67 67
 
68 68
 	/**
69 69
 	 * Any fields you want to return in a data map selection if not the default.
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 *   string (otherwise with a space) and prefix postfix arguments will be
75 75
 	 *   applied to it.
76 76
 	 */
77
-	public $dataMapFields=[];
77
+	public $dataMapFields = [];
78 78
 
79 79
 	/**
80 80
 	 * @inheritdoc
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @return array
134 134
 	 * @throws \Exception
135 135
 	 */
136
-	public function getMapObjects($query=null, $start=0, $length=100)
136
+	public function getMapObjects($query = null, $start = 0, $length = 100)
137 137
 	{
138 138
 		$provider = $this->getProviderService();
139 139
 		$format = ['prefix'=>'', 'concat'=>' ', 'postfix' => ''];
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		$items = $this->getItems();
171 171
 		if (is_array($this->value)) {
172 172
 			$values = array_intersect_key($items, array_flip($this->value));
173
-			return implode(', ',$values);
173
+			return implode(', ', $values);
174 174
 		} else if (isset($items[$this->value])) {
175 175
 			return $items[$this->value];
176 176
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	/**
206 206
 	 * @inheritdoc
207 207
 	 */
208
-	public function processAsFilter(IQuery $query, $searchData=null)
208
+	public function processAsFilter(IQuery $query, $searchData = null)
209 209
 	{
210 210
 		$searchData = ($searchData === null) ? $this->getValue() : $searchData;
211 211
 		if ($searchData !== '') {
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,8 +96,9 @@  discard block
 block discarded – undo
96 96
 	public function getItems()
97 97
 	{
98 98
 		// if we haven't or can't map a map request we can't have any values
99
-		if (empty($this->dataMapKey))
100
-			return [];
99
+		if (empty($this->dataMapKey)) {
100
+					return [];
101
+		}
101 102
 
102 103
 		$provider = $this->getProviderService();
103 104
 		$format = false;
@@ -119,8 +120,9 @@  discard block
 block discarded – undo
119 120
 			$concat = isset($format['concat']) ? $format['concat'] : ' ';
120 121
 			$prefix = isset($format['prefix']) ? $format['prefix'] : '';
121 122
 			$postfix = isset($format['postfix']) ? $format['postfix'] : '';
122
-			foreach ($items as $k=>$i)
123
-				$items[$k] = $prefix.implode($concat, is_array($i) ? $i : [$i]).$postfix;
123
+			foreach ($items as $k=>$i) {
124
+							$items[$k] = $prefix.implode($concat, is_array($i) ? $i : [$i]).$postfix;
125
+			}
124 126
 		}
125 127
 		return $items;
126 128
 	}
@@ -184,8 +186,9 @@  discard block
 block discarded – undo
184 186
 	public function setValueFromDb($value)
185 187
 	{
186 188
 		parent::setValueFromDb($value);
187
-		if (!empty($value))
188
-			$this->makeMapRequest($value);
189
+		if (!empty($value)) {
190
+					$this->makeMapRequest($value);
191
+		}
189 192
 		return $this;
190 193
 	}
191 194
 
Please login to merge, or discard this patch.
neon/core/form/fields/Password.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 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
 	}
Please login to merge, or discard this patch.
neon/core/form/fields/Image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 	public function getData()
56 56
 	{
57 57
 		$name = $this->getInputName();
58
-		if ( neon()->request->hasFile($name) ) {
58
+		if (neon()->request->hasFile($name)) {
59 59
 			$this->value = neon()->request->file($name)->save();
60 60
 		}
61 61
 		return $this->value;
Please login to merge, or discard this patch.
neon/core/form/fields/Submit.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 	public function setValue($value)
54 54
 	{
55 55
 		if ($value === 'true' || $value === true)
56
-			$this->getForm()->submittedButton=$this->getName();
56
+			$this->getForm()->submittedButton = $this->getName();
57 57
 		return $this;
58 58
 	}
59 59
 }
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@
 block discarded – undo
52 52
 	 */
53 53
 	public function setValue($value)
54 54
 	{
55
-		if ($value === 'true' || $value === true)
56
-			$this->getForm()->submittedButton=$this->getName();
55
+		if ($value === 'true' || $value === true) {
56
+					$this->getForm()->submittedButton=$this->getName();
57
+		}
57 58
 		return $this;
58 59
 	}
59 60
 }
60 61
\ No newline at end of file
Please login to merge, or discard this patch.
neon/core/form/fields/Text.php 2 patches
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.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@
 block discarded – undo
50 50
 	{
51 51
 		$guesser = new \Faker\Guesser\Name(faker());
52 52
 		$guess = $guesser->guessFormat($this->getName(), 150);
53
-		if (is_callable($guess))
54
-			return $guess();
53
+		if (is_callable($guess)) {
54
+					return $guess();
55
+		}
55 56
 		return faker()->realText(mt_rand(10, 150));
56 57
 	}
57 58
 }
58 59
\ No newline at end of file
Please login to merge, or discard this patch.