Passed
Push — develop ( 319bd8...330c7a )
by Neill
16:41 queued 15s
created
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
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.
Spacing   +6 added lines, -6 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' => ''];
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
 	/**
166 166
 	 * @inheritdoc
167 167
 	 */
168
-	public function getValueDisplay($context='')
168
+	public function getValueDisplay($context = '')
169 169
 	{
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.
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
 
Please login to merge, or discard this patch.
neon/core/form/fields/Guidance.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@
 block discarded – undo
21 21
 	 */
22 22
 	public function getFieldHtml()
23 23
 	{
24
-        return Html::tag('neon-core-form-fields-guidance', [
25
-        	'text' => $this->getText(),
26
-        ]);
24
+		return Html::tag('neon-core-form-fields-guidance', [
25
+			'text' => $this->getText(),
26
+		]);
27 27
 	}
28 28
 
29 29
 	/**
Please login to merge, or discard this patch.
neon/core/form/fields/el/DateRange.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@
 block discarded – undo
31 31
 	public function getValue()
32 32
 	{
33 33
 		$value = parent::getValue();
34
-		if (is_array($value))
35
-			return $value;
34
+		if (is_array($value)) {
35
+					return $value;
36
+		}
36 37
 		return ['from' => '', 'to' => ''];
37 38
 	}
38 39
 
Please login to merge, or discard this patch.
neon/core/form/fields/el/DateTimeRange.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 	/**
61 61
 	 * @inheritdoc
62 62
 	 */
63
-	public function processAsFilter(IQuery $query, $searchData=null)
63
+	public function processAsFilter(IQuery $query, $searchData = null)
64 64
 	{
65 65
 		$searchData = ($searchData === null) ? $this->getValue() : $searchData;
66 66
 		if ($searchData !== '') {
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,10 +66,12 @@  discard block
 block discarded – undo
66 66
 		if ($searchData !== '') {
67 67
 			$dateFrom = Arr::get($searchData, 'from');
68 68
 			$dateTo   = Arr::get($searchData, 'to');
69
-			if ($dateFrom)
70
-				$query->where($this->getDataKey(), '>=', $dateFrom);
71
-			if ($dateTo)
72
-				$query->where($this->getDataKey(), '<=', $dateTo);
69
+			if ($dateFrom) {
70
+							$query->where($this->getDataKey(), '>=', $dateFrom);
71
+			}
72
+			if ($dateTo) {
73
+							$query->where($this->getDataKey(), '<=', $dateTo);
74
+			}
73 75
 		}
74 76
 	}
75 77
 
@@ -87,8 +89,9 @@  discard block
 block discarded – undo
87 89
 	public function getValue()
88 90
 	{
89 91
 		$value = parent::getValue();
90
-		if (is_array($value))
91
-			return $value;
92
+		if (is_array($value)) {
93
+					return $value;
94
+		}
92 95
 		return ['from' => '', 'to' => ''];
93 96
 	}
94 97
 
Please login to merge, or discard this patch.
neon/core/form/fields/el/Slider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	 */
26 26
 	public function getProperties()
27 27
 	{
28
-		return array_merge(parent::getProperties(), ['decimal', 'height', 'vertical', 'min', 'max'] );
28
+		return array_merge(parent::getProperties(), ['decimal', 'height', 'vertical', 'min', 'max']);
29 29
 	}
30 30
 	/**
31 31
 	 * @inheritdoc
Please login to merge, or discard this patch.
neon/core/form/fields/DisplayText.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 	/**
74 74
 	 * @inheritdoc
75 75
 	 */
76
-	public function processAsFilter(IQuery $query, $searchData=null)
76
+	public function processAsFilter(IQuery $query, $searchData = null)
77 77
 	{
78 78
 		// no filters can be applied here - so we override and do nothing.
79 79
 	}
Please login to merge, or discard this patch.
neon/core/form/fields/UrlLink.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,8 +61,9 @@  discard block
 block discarded – undo
61 61
 			// disallow any quotes in the URL to prevent a class of attacks
62 62
 			if (strpos($value, "'") === false && strpos($value,'"') === false) {
63 63
 				// prefix with the schema if not provided
64
-				if ($value && $this->absolute && strpos($value, 'http')===false)
65
-					$value = str_replace('///','//','https://'.$value);
64
+				if ($value && $this->absolute && strpos($value, 'http')===false) {
65
+									$value = str_replace('///','//','https://'.$value);
66
+				}
66 67
 				// now turn into a link and run through purify to strip
67 68
 				// out any dodgy shenanigans
68 69
 				$link = '<a href="'.$value.'">';
@@ -71,8 +72,9 @@  discard block
 block discarded – undo
71 72
 					$exploded = explode('"',$safeValue);
72 73
 					$this->_sanitisedValue = $exploded[1];
73 74
 				}
74
-			} else
75
-				$this->_sanitisedValue = '';
75
+			} else {
76
+							$this->_sanitisedValue = '';
77
+			}
76 78
 		}
77 79
 		return $this->_sanitisedValue;
78 80
 	}
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * set whether or not this is an absolute or relative URL
23 23
 	 */
24
-	public $absolute=true;
24
+	public $absolute = true;
25 25
 
26 26
 	/**
27 27
 	 * Set some allowable tags for single text fields
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	 * Get a displayable representation of the fields value
45 45
 	 * @return string
46 46
 	 */
47
-	public function getValueDisplay($context='')
47
+	public function getValueDisplay($context = '')
48 48
 	{
49
-		return '<a href="'.$this->getValue().'" target="_blank" noopener noreferrer>'.$this->getValue().'</a>' ;
49
+		return '<a href="'.$this->getValue().'" target="_blank" noopener noreferrer>'.$this->getValue().'</a>';
50 50
 	}
51 51
 
52 52
 	/**
@@ -59,16 +59,16 @@  discard block
 block discarded – undo
59 59
 		if ($this->_sanitisedValue === null) {
60 60
 			$value = $this->getUnsafeValue();
61 61
 			// disallow any quotes in the URL to prevent a class of attacks
62
-			if (strpos($value, "'") === false && strpos($value,'"') === false) {
62
+			if (strpos($value, "'") === false && strpos($value, '"') === false) {
63 63
 				// prefix with the schema if not provided
64
-				if ($value && $this->absolute && strpos($value, 'http')===false)
65
-					$value = str_replace('///','//','https://'.$value);
64
+				if ($value && $this->absolute && strpos($value, 'http') === false)
65
+					$value = str_replace('///', '//', 'https://'.$value);
66 66
 				// now turn into a link and run through purify to strip
67 67
 				// out any dodgy shenanigans
68 68
 				$link = '<a href="'.$value.'">';
69 69
 				$safeValue = $this->purifyInput($link);
70 70
 				if (strpos($safeValue, 'href')) {
71
-					$exploded = explode('"',$safeValue);
71
+					$exploded = explode('"', $safeValue);
72 72
 					$this->_sanitisedValue = $exploded[1];
73 73
 				}
74 74
 			} else
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	public function getProperties()
84 84
 	{
85 85
 		// convert the database values to booleans
86
-		$this->absolute = (bool)$this->absolute;
86
+		$this->absolute = (bool) $this->absolute;
87 87
 		$properties = parent::getProperties();
88 88
 		$properties[] = 'absolute';
89 89
 		return $properties;
Please login to merge, or discard this patch.