Completed
Push — master ( 5b3666...b3a3fe )
by Jean-Christophe
04:35
created
Ajax/common/components/SimpleComponent.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 	public function __construct(JsUtils $js) {
18 18
 		parent::__construct($js);
19
-		$this->events=array ();
19
+		$this->events=array();
20 20
 	}
21 21
 
22 22
 	protected function compileEvents() {
23
-		foreach ( $this->events as $event => $jsCode ) {
24
-			if($event=="execute"){
23
+		foreach ($this->events as $event => $jsCode) {
24
+			if ($event=="execute") {
25 25
 				$this->jquery_code_for_compile []=$jsCode;
26
-			}else if($event=="beforeExecute"){
26
+			}else if ($event=="beforeExecute") {
27 27
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
28 28
 			}else
29 29
 				$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		$result=implode("\n", $this->jquery_code_for_compile);
35 35
 		$result=str_ireplace("\"%", "", $result);
36 36
 		$result=str_ireplace("%\"", "", $result);
37
-		$result=str_replace(array (
37
+		$result=str_replace(array(
38 38
 				"\\n",
39 39
 				"\\r",
40 40
 				"\\t"
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public function getScript() {
46 46
 		$allParams=$this->params;
47
-		$this->jquery_code_for_compile=array ();
47
+		$this->jquery_code_for_compile=array();
48 48
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
49 49
 		$this->compileEvents();
50 50
 		return $this->compileJQueryCode();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		if (is_array($typeCtrl)) {
72 72
 			if (array_search($value, $typeCtrl)===false)
73 73
 				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
74
-		} else {
74
+		}else {
75 75
 			if (!$typeCtrl($value)) {
76 76
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
77 77
 			}
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,10 +23,11 @@  discard block
 block discarded – undo
23 23
 		foreach ( $this->events as $event => $jsCode ) {
24 24
 			if($event=="execute"){
25 25
 				$this->jquery_code_for_compile []=$jsCode;
26
-			}else if($event=="beforeExecute"){
26
+			} else if($event=="beforeExecute"){
27 27
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
28
-			}else
29
-				$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
28
+			} else {
29
+							$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
30
+			}
30 31
 		}
31 32
 	}
32 33
 
@@ -69,8 +70,9 @@  discard block
 block discarded – undo
69 70
 
70 71
 	protected function setParamCtrl($key, $value, $typeCtrl) {
71 72
 		if (is_array($typeCtrl)) {
72
-			if (array_search($value, $typeCtrl)===false)
73
-				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
73
+			if (array_search($value, $typeCtrl)===false) {
74
+							throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
75
+			}
74 76
 		} else {
75 77
 			if (!$typeCtrl($value)) {
76 78
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
Please login to merge, or discard this patch.
Ajax/semantic/components/search/SearchCategories.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@
 block discarded – undo
20 20
 		$result=array ();
21 21
 		foreach ( $this->categories as $category ) {
22 22
 			$r=$category->search($query, $field);
23
-			if ($r !== false)
24
-				$result[]=$r;
23
+			if ($r !== false) {
24
+							$result[]=$r;
25
+			}
25 26
 		}
26 27
 		$this->categories=$result;
27 28
 		return $this;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@  discard block
 block discarded – undo
6 6
 	private $categories;
7 7
 
8 8
 	public function __construct() {
9
-		$this->categories=array ();
9
+		$this->categories=array();
10 10
 	}
11 11
 
12 12
 	public function add($results, $category) {
13 13
 		$count=\sizeof($this->categories);
14 14
 		if (\array_key_exists($category, $this->categories)) {
15 15
 			$this->categories[$category]->addResults($results);
16
-		} else {
17
-			$categoryO=new SearchCategory("category" . $count, $category, $results);
16
+		}else {
17
+			$categoryO=new SearchCategory("category".$count, $category, $results);
18 18
 			$this->categories[$category]=$categoryO;
19 19
 		}
20 20
 		return $this;
21 21
 	}
22 22
 
23 23
 	public function search($query, $field="title") {
24
-		$result=array ();
25
-		foreach ( $this->categories as $category ) {
24
+		$result=array();
25
+		foreach ($this->categories as $category) {
26 26
 			$r=$category->search($query, $field);
27
-			if ($r !== false)
27
+			if ($r!==false)
28 28
 				$result[]=$r;
29 29
 		}
30 30
 		$this->categories=$result;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	public function __toString() {
35
-		return "{\"results\":{" . \implode(",", \array_values($this->categories)) . "}}";
35
+		return "{\"results\":{".\implode(",", \array_values($this->categories))."}}";
36 36
 	}
37 37
 
38 38
 	public function getResponse() {
Please login to merge, or discard this patch.
Ajax/semantic/components/search/SearchCategory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public function __toString() {
27
-		$result="\"" . $this->id . "\": { \"name\": \"" . $this->name . "\"," . $this->results . "}";
27
+		$result="\"".$this->id."\": { \"name\": \"".$this->name."\",".$this->results."}";
28 28
 		return $result;
29 29
 	}
30 30
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function search($query, $field="title") {
59 59
 		$result=$this->results->search($query, $field);
60
-		if ($result !== false) {
60
+		if ($result!==false) {
61 61
 			return new SearchCategory($this->id, $this->name, $result);
62 62
 		}
63 63
 		return false;
Please login to merge, or discard this patch.
Ajax/semantic/components/search/AbstractSearchResult.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 	public function fromDatabaseObjects($objects, $function) {
8 8
 		if (isset($objects)) {
9
-			foreach ( $objects as $object ) {
9
+			foreach ($objects as $object) {
10 10
 				$this->fromDatabaseObject($object, $function);
11 11
 			}
12 12
 		}
Please login to merge, or discard this patch.
Ajax/semantic/components/search/SearchResult.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,9 @@
 block discarded – undo
77 77
 		$vars=get_object_vars($this);
78 78
 		$result=array ();
79 79
 		foreach ( $vars as $k => $v ) {
80
-			if (isset($v))
81
-				$result[$k]=$v;
80
+			if (isset($v)) {
81
+							$result[$k]=$v;
82
+			}
82 83
 		}
83 84
 		return $result;
84 85
 	}
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	public function __construct($id=NULL, $title=NULL, $description=NULL, $image=NULL, $price=NULL) {
13 13
 		if (\is_array($id)) {
14 14
 			$this->fromArray($id);
15
-		} else {
15
+		}else {
16 16
 			$this->id=$id;
17 17
 			$this->title=$title;
18 18
 			$this->description=$description;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	}
68 68
 
69 69
 	public function fromArray($array) {
70
-		foreach ( $array as $key => $value ) {
70
+		foreach ($array as $key => $value) {
71 71
 			$this->{$key}=$value;
72 72
 		}
73 73
 		return $this;
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 
80 80
 	public function JsonSerialize() {
81 81
 		$vars=get_object_vars($this);
82
-		$result=array ();
83
-		foreach ( $vars as $k => $v ) {
82
+		$result=array();
83
+		foreach ($vars as $k => $v) {
84 84
 			if (isset($v))
85 85
 				$result[$k]=$v;
86 86
 		}
@@ -89,6 +89,6 @@  discard block
 block discarded – undo
89 89
 
90 90
 	public function search($query, $field="title") {
91 91
 		$value=$this->$field;
92
-		return \stripos($value, $query) !== false;
92
+		return \stripos($value, $query)!==false;
93 93
 	}
94 94
 }
95 95
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSearch.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,12 @@
 block discarded – undo
22 22
 
23 23
 	private function createField($placeholder=NULL, $icon=NULL) {
24 24
 		$field=new HtmlInput($this->identifier);
25
-		if (isset($placeholder) === true)
26
-			$field->setPlaceholder($placeholder);
27
-		if (isset($icon) === true)
28
-			$field->addIcon($icon, Direction::RIGHT);
25
+		if (isset($placeholder) === true) {
26
+					$field->setPlaceholder($placeholder);
27
+		}
28
+		if (isset($icon) === true) {
29
+					$field->addIcon($icon, Direction::RIGHT);
30
+		}
29 31
 		$field->getField()->setClass("prompt");
30 32
 		$this->content["field"]=$field;
31 33
 		return $field;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 use Ajax\semantic\html\base\constants\Direction;
9 9
 
10 10
 class HtmlSearch extends HtmlSemDoubleElement {
11
-	private $_elements=array ();
12
-	private $_params=array ();
13
-	private $_searchFields=array ("title" );
11
+	private $_elements=array();
12
+	private $_params=array();
13
+	private $_searchFields=array("title");
14 14
 	private $_local=false;
15 15
 
16 16
 	public function __construct($identifier, $placeholder=NULL, $icon=NULL) {
17
-		parent::__construct("search-" . $identifier, "div", "ui search", array ());
17
+		parent::__construct("search-".$identifier, "div", "ui search", array());
18 18
 		$this->createField($placeholder, $icon);
19 19
 		$this->createResult();
20 20
 		$this->_params["type"]="standard";
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 	private function createField($placeholder=NULL, $icon=NULL) {
24 24
 		$field=new HtmlInput($this->identifier);
25
-		if (isset($placeholder) === true)
25
+		if (isset($placeholder)===true)
26 26
 			$field->setPlaceholder($placeholder);
27
-		if (isset($icon) === true)
27
+		if (isset($icon)===true)
28 28
 			$field->addIcon($icon, Direction::RIGHT);
29 29
 		$field->getField()->setClass("prompt");
30 30
 		$this->content["field"]=$field;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	private function createResult() {
35
-		$this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results");
35
+		$this->content["result"]=new HtmlSemDoubleElement("results-".$this->identifier, "div", "results");
36 36
 		return $this->content["result"];
37 37
 	}
38 38
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	public function setUrl($url) {
52
-		$this->_params["apiSettings"]="%{url: %quote%" . $url . "%quote%}%";
52
+		$this->_params["apiSettings"]="%{url: %quote%".$url."%quote%}%";
53 53
 		return $this;
54 54
 	}
55 55
 
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	public function run(JsUtils $js) {
75
-		$this->_params["onSelect"]='%function(result,response){$(%quote%#' . $this->identifier . '%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
75
+		$this->_params["onSelect"]='%function(result,response){$(%quote%#'.$this->identifier.'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
76 76
 		$searchFields=\json_encode($this->_searchFields);
77 77
 		$searchFields=str_ireplace("\"", "%quote%", $searchFields);
78
-		$this->_params["searchFields"]="%" . $searchFields . "%";
79
-		if ($this->_local === true) {
78
+		$this->_params["searchFields"]="%".$searchFields."%";
79
+		if ($this->_local===true) {
80 80
 			$this->_params["source"]="%content%";
81
-			$this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";");
81
+			$this->addEvent("beforeExecute", "var content=".$this->resultsToJson().";");
82 82
 		}
83
-		if (isset($this->_bsComponent) === false) {
84
-			$this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params);
83
+		if (isset($this->_bsComponent)===false) {
84
+			$this->_bsComponent=$js->semantic()->search("#".$this->identifier, $this->_params);
85 85
 		}
86 86
 		$this->addEventsOnRun($js);
87 87
 		return $this->_bsComponent;
Please login to merge, or discard this patch.
Ajax/semantic/components/search/SearchResults.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
 	private $elements;
9 9
 
10 10
 	public function __construct($objects=NULL) {
11
-		$this->elements=array ();
11
+		$this->elements=array();
12 12
 		if (isset($objects)) {
13 13
 			if (\is_array($objects)) {
14 14
 				$this->addResults($objects);
15
-			} else {
15
+			}else {
16 16
 				$this->addResult($objects);
17 17
 			}
18 18
 		}
@@ -23,42 +23,42 @@  discard block
 block discarded – undo
23 23
 			$this->elements[]=$object;
24 24
 			return $this;
25 25
 		}
26
-		if (\is_array($object) === false) {
27
-			$object=[ "title" => $object ];
26
+		if (\is_array($object)===false) {
27
+			$object=["title" => $object];
28 28
 		}
29 29
 		$this->elements[]=new SearchResult($object);
30 30
 		return $this;
31 31
 	}
32 32
 
33 33
 	public function addResults($objects) {
34
-		if (\is_array($objects) === false) {
34
+		if (\is_array($objects)===false) {
35 35
 			return $this->addResult($objects);
36 36
 		}
37
-		if (JArray::dimension($objects) === 1) {
38
-			foreach ( $objects as $object ) {
39
-				$this->addResult([ "title" => $object ]);
37
+		if (JArray::dimension($objects)===1) {
38
+			foreach ($objects as $object) {
39
+				$this->addResult(["title" => $object]);
40 40
 			}
41
-		} else
41
+		}else
42 42
 			$this->elements=\array_merge($this->elements, $objects);
43 43
 		return $this;
44 44
 	}
45 45
 
46 46
 	public function _search($query, $field="title") {
47
-		$result=array ();
48
-		foreach ( $this->elements as $element ) {
47
+		$result=array();
48
+		foreach ($this->elements as $element) {
49 49
 			if ($element instanceof SearchResult) {
50
-				if ($element->search($query, $field) !== false)
50
+				if ($element->search($query, $field)!==false)
51 51
 					$result[]=$element->asArray();
52
-			} else {
52
+			}else {
53 53
 				if (\array_key_exists($field, $element)) {
54 54
 					$value=$element[$field];
55
-					if (\stripos($value, $query) !== false) {
55
+					if (\stripos($value, $query)!==false) {
56 56
 						$result[]=$element;
57 57
 					}
58 58
 				}
59 59
 			}
60 60
 		}
61
-		if (\sizeof($result) > 0) {
61
+		if (\sizeof($result)>0) {
62 62
 			return $result;
63 63
 		}
64 64
 		return false;
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public function search($query, $field="title") {
68 68
 		$result=$this->_search($query, $field);
69
-		if ($result === false)
69
+		if ($result===false)
70 70
 			$result=NULL;
71 71
 		return new SearchResults($result);
72 72
 	}
73 73
 
74 74
 	public function __toString() {
75
-		$result="\"results\": " . \json_encode($this->elements);
75
+		$result="\"results\": ".\json_encode($this->elements);
76 76
 		return $result;
77 77
 	}
78 78
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	public function getResponse() {
84
-		return "{" . $this . "}";
84
+		return "{".$this."}";
85 85
 	}
86 86
 
87 87
 	/**
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
 			foreach ( $objects as $object ) {
39 39
 				$this->addResult([ "title" => $object ]);
40 40
 			}
41
-		} else
42
-			$this->elements=\array_merge($this->elements, $objects);
41
+		} else {
42
+					$this->elements=\array_merge($this->elements, $objects);
43
+		}
43 44
 		return $this;
44 45
 	}
45 46
 
@@ -47,8 +48,9 @@  discard block
 block discarded – undo
47 48
 		$result=array ();
48 49
 		foreach ( $this->elements as $element ) {
49 50
 			if ($element instanceof SearchResult) {
50
-				if ($element->search($query, $field) !== false)
51
-					$result[]=$element->asArray();
51
+				if ($element->search($query, $field) !== false) {
52
+									$result[]=$element->asArray();
53
+				}
52 54
 			} else {
53 55
 				if (\array_key_exists($field, $element)) {
54 56
 					$value=$element[$field];
@@ -66,8 +68,9 @@  discard block
 block discarded – undo
66 68
 
67 69
 	public function search($query, $field="title") {
68 70
 		$result=$this->_search($query, $field);
69
-		if ($result === false)
70
-			$result=NULL;
71
+		if ($result === false) {
72
+					$result=NULL;
73
+		}
71 74
 		return new SearchResults($result);
72 75
 	}
73 76
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDimmer.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 class HtmlDimmer extends HtmlSemDoubleElement {
11 11
 	private $_container;
12
-	private $_params=array ();
12
+	private $_params=array();
13 13
 	private $_inverted;
14 14
 
15 15
 	public function __construct($identifier, $content=NULL) {
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	public function setContent($content) {
22
-		$this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
22
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
23 23
 		return $this;
24 24
 	}
25 25
 
26 26
 	public function asIcon($icon, $title, $subHeader=NULL) {
27
-		$header=new HtmlHeader("header-" . $this->identifier);
27
+		$header=new HtmlHeader("header-".$this->identifier);
28 28
 		$header->asIcon($icon, $title, $subHeader);
29
-		if ($this->_inverted === false)
29
+		if ($this->_inverted===false)
30 30
 			$header->setInverted();
31 31
 		return $this->setContent($header);
32 32
 	}
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 
44 44
 	public function run(JsUtils $js) {
45 45
 		if ($this->_container instanceof HtmlSingleElement)
46
-			$this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
46
+			$this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params);
47 47
 		return parent::run($js);
48 48
 	}
49 49
 
50 50
 	public function jsShow() {
51
-		if (isset($this->_container) === true)
52
-			return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
51
+		if (isset($this->_container)===true)
52
+			return '$("#.'.$this->_container->getIdentifier().').dimmer("show");';
53 53
 	}
54 54
 
55 55
 	public function setBlurring() {
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@  discard block
 block discarded – undo
26 26
 	public function asIcon($icon, $title, $subHeader=NULL) {
27 27
 		$header=new HtmlHeader("header-" . $this->identifier);
28 28
 		$header->asIcon($icon, $title, $subHeader);
29
-		if ($this->_inverted === false)
30
-			$header->setInverted();
29
+		if ($this->_inverted === false) {
30
+					$header->setInverted();
31
+		}
31 32
 		return $this->setContent($header);
32 33
 	}
33 34
 
@@ -42,14 +43,16 @@  discard block
 block discarded – undo
42 43
 	}
43 44
 
44 45
 	public function run(JsUtils $js) {
45
-		if ($this->_container instanceof HtmlSingleElement)
46
-			$this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
46
+		if ($this->_container instanceof HtmlSingleElement) {
47
+					$this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
48
+		}
47 49
 		return parent::run($js);
48 50
 	}
49 51
 
50 52
 	public function jsShow() {
51
-		if (isset($this->_container) === true)
52
-			return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
53
+		if (isset($this->_container) === true) {
54
+					return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
55
+		}
53 56
 	}
54 57
 
55 58
 	public function setBlurring() {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlImage.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,9 @@  discard block
 block discarded – undo
11 11
 	public function __construct($identifier, $src="", $alt="", $size=NULL) {
12 12
 		$image=new HtmlImg("img-", $src, $alt);
13 13
 		parent::__construct($identifier, "div", "ui image", $image);
14
-		if (isset($size))
15
-			$this->setSize($size);
14
+		if (isset($size)) {
15
+					$this->setSize($size);
16
+		}
16 17
 	}
17 18
 
18 19
 	public function setCircular() {
@@ -20,8 +21,9 @@  discard block
 block discarded – undo
20 21
 	}
21 22
 
22 23
 	public function asAvatar($caption=NULL) {
23
-		if (isset($caption))
24
-			$this->wrap("", $caption);
24
+		if (isset($caption)) {
25
+					$this->wrap("", $caption);
26
+		}
25 27
 		return $this->addToProperty("class", "avatar");
26 28
 	}
27 29
 
Please login to merge, or discard this patch.