Passed
Push — master ( 1d8d13...de8c14 )
by Jean-Christophe
04:21
created
Ajax/common/components/BaseComponent.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function getParam($key) {
41 41
 		$value=null;
42
-		if (array_key_exists($key, $this->params))
43
-			$value=$this->params [$key];
42
+		if (array_key_exists($key, $this->params)) {
43
+					$value=$this->params [$key];
44
+		}
44 45
 		return $value;
45 46
 	}
46 47
 
@@ -49,16 +50,18 @@  discard block
 block discarded – undo
49 50
 	}
50 51
 
51 52
 	public function compile(JsUtils $js=NULL) {
52
-		if ($js==NULL)
53
-			$js=$this->js;
53
+		if ($js==NULL) {
54
+					$js=$this->js;
55
+		}
54 56
 		$script=$this->getScript();
55 57
 		$js->addToCompile($script);
56 58
 	}
57 59
 
58 60
 	protected function setParamCtrl($key, $value, $typeCtrl) {
59 61
 		if (\is_array($typeCtrl)) {
60
-			if (array_search($value, $typeCtrl)===false)
61
-				throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
62
+			if (array_search($value, $typeCtrl)===false) {
63
+							throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
64
+			}
62 65
 		} else {
63 66
 			if (!$typeCtrl($value)) {
64 67
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key);
@@ -70,9 +73,9 @@  discard block
 block discarded – undo
70 73
 	public function setParams($params) {
71 74
 		foreach ( $params as $k => $v ) {
72 75
 			$method="set".ucfirst($k);
73
-			if (method_exists($this, $method))
74
-				$this->$method($v);
75
-			else {
76
+			if (method_exists($this, $method)) {
77
+							$this->$method($v);
78
+			} else {
76 79
 				$this->setParam($k, $v);
77 80
 				trigger_error("`{$k}` doesn't exists!", E_USER_NOTICE);
78 81
 			}
Please login to merge, or discard this patch.