Passed
Pull Request — master (#46)
by Neo
33:01
created
api/src/Etemplate/Widget/Taglist.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@  discard block
 block discarded – undo
44 44
 	{
45 45
 		$this->attrs['allowFreeEntries'] = true;
46 46
 
47
-		if($xml) {
47
+		if($xml)
48
+		{
48 49
 			parent::__construct($xml);
49 50
 		}
50 51
 	}
@@ -80,7 +81,8 @@  discard block
 block discarded – undo
80 81
 			$results[] = array('id' => $id, 'label' => $name);
81 82
 		}
82 83
 		
83
-		usort($results, function ($a, $b) use ($query) {
84
+		usort($results, function ($a, $b) use ($query)
85
+		{
84 86
 		    similar_text($query, $a["label"], $percent_a);
85 87
 		    similar_text($query, $b["label"], $percent_b);
86 88
 		    return $percent_a === $percent_b ? 0 : ($percent_a > $percent_b ? -1 : 1);
@@ -149,8 +151,7 @@  discard block
 block discarded – undo
149 151
 						!($this->attrs['domainOptional'] && preg_match (Taglist::EMAIL_PREG_NO_DOMAIN, $val)) &&
150 152
 					// Allow merge placeholders.  Might be a better way to do this though.
151 153
 					!preg_match('/{{.+}}|\$\$.+\$\$/',$val)
152
-				)
153
-				{
154
+				) {
154 155
 					self::set_validation_error($form_name,lang("'%1' has an invalid format",$val),'');
155 156
 				}
156 157
 			}
@@ -165,7 +166,10 @@  discard block
 block discarded – undo
165 166
 			$valid =& self::get_array($validated, $form_name, true);
166 167
 			// returning null instead of array(), as array() will be overwritten by etemplate_new::complete_array_merge()
167 168
 			// with preserved old content and therefore user can not empty a taglist
168
-			if (true) $valid = $value ? $value : null;
169
+			if (true)
170
+			{
171
+				$valid = $value ? $value : null;
172
+			}
169 173
 			//error_log(__METHOD__."() $form_name: ".array2string($value_in).' --> '.array2string($value).', allowed='.array2string($allowed));
170 174
 		}
171 175
 	}
Please login to merge, or discard this patch.