Completed
Push — master ( 66af5c...1d23a1 )
by Jean-Christophe
03:38
created
Ajax/semantic/html/collections/form/HtmlFormRadio.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  */
11 11
 class HtmlFormRadio extends AbstractHtmlFormRadioCheckbox {
12 12
 
13
-	public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL,$type=NULL) {
14
-		parent::__construct($identifier, $name,$label,$value,$type);
13
+	public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $type=NULL) {
14
+		parent::__construct($identifier, $name, $label, $value, $type);
15 15
 		$this->_input->getField()->setProperty("type", "radio");
16 16
 		$this->_input->setClass("ui radio checkbox");
17
-		if(isset($name))
17
+		if (isset($name))
18 18
 			$this->_input->getField()->setProperty("name", $name);
19
-		if(isset($type))
19
+		if (isset($type))
20 20
 			$this->setType($type);
21 21
 	}
22 22
 }
23 23
\ 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
@@ -14,9 +14,11 @@
 block discarded – undo
14 14
 		parent::__construct($identifier, $name,$label,$value,$type);
15 15
 		$this->_input->getField()->setProperty("type", "radio");
16 16
 		$this->_input->setClass("ui radio checkbox");
17
-		if(isset($name))
18
-			$this->_input->getField()->setProperty("name", $name);
19
-		if(isset($type))
20
-			$this->setType($type);
17
+		if(isset($name)) {
18
+					$this->_input->getField()->setProperty("name", $name);
19
+		}
20
+		if(isset($type)) {
21
+					$this->setType($type);
22
+		}
21 23
 	}
22 24
 }
23 25
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormInput.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@
 block discarded – undo
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 	use TextFieldsTrait;
10 10
 
11
-	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
11
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
12
+		if (!isset($placeholder) && $type==="text")
13 13
 			$placeholder=$label;
14
-		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
14
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
15 15
 	}
16 16
 
17
-	public function setReadonly(){
17
+	public function setReadonly() {
18 18
 		$this->getField()->setProperty("readonly", "");
19 19
 	}
20 20
 }
21 21
\ 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
@@ -9,8 +9,9 @@
 block discarded – undo
9 9
 	use TextFieldsTrait;
10 10
 
11 11
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
13
-			$placeholder=$label;
12
+		if(!isset($placeholder) && $type==="text") {
13
+					$placeholder=$label;
14
+		}
14 15
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
15 16
 	}
16 17
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlPopup.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 class HtmlPopup extends HtmlSemDoubleElement {
13 13
 	private $_params;
14 14
 	private $_container;
15
-	public function __construct(BaseHtml $container,$identifier, $content="") {
15
+	public function __construct(BaseHtml $container, $identifier, $content="") {
16 16
 		parent::__construct($identifier, "div");
17 17
 		$this->_container=$container;
18 18
 		$this->setClass("ui popup");
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 		$this->_params=array("on"=>"hover");
21 21
 	}
22 22
 
23
-	public function addList($items=array(),$header=NULL){
24
-		if(!$this->content instanceof HtmlGrid){
25
-			$this->content=new HtmlGrid("Grid-".$this->identifier,0);
23
+	public function addList($items=array(), $header=NULL) {
24
+		if (!$this->content instanceof HtmlGrid) {
25
+			$this->content=new HtmlGrid("Grid-".$this->identifier, 0);
26 26
 		}
27 27
 		$grid=$this->content;
28 28
 
29 29
 		$colCount=$grid->colCount();
30 30
 		$grid->setColsCount(++$colCount);
31 31
 
32
-		$list=new HtmlList("",$items);
32
+		$list=new HtmlList("", $items);
33 33
 		$list->asLink();
34
-		if(isset($header)){
35
-			$list->addHeader(4,$header);
34
+		if (isset($header)) {
35
+			$list->addHeader(4, $header);
36 36
 		}
37
-		$grid->getCell(0,$colCount-1)->setContent($list);
37
+		$grid->getCell(0, $colCount-1)->setContent($list);
38 38
 		$grid->setDivided()->setRelaxed(true);
39 39
 		return $list;
40 40
 	}
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * A popup can have no maximum width and continue to flow to fit its content
44 44
 	 */
45
-	public function setFlowing(){
45
+	public function setFlowing() {
46 46
 		return $this->addToProperty("class", "flowing");
47 47
 	}
48 48
 
49 49
 	/**
50 50
 	 * A popup can provide more basic formatting
51 51
 	 */
52
-	public function setBasic(){
52
+	public function setBasic() {
53 53
 		return $this->addToProperty("class", "basic");
54 54
 	}
55 55
 
@@ -57,22 +57,22 @@  discard block
 block discarded – undo
57 57
 	 * {@inheritDoc}
58 58
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
59 59
 	 */
60
-	public function run(JsUtils $js){
60
+	public function run(JsUtils $js) {
61 61
 		$this->_params["popup"]="#".$this->identifier;
62
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params);
62
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params);
63 63
 	}
64 64
 
65
-	public function setOn($event="click"){
65
+	public function setOn($event="click") {
66 66
 		$this->_params["on"]=$event;
67 67
 		return $this;
68 68
 	}
69 69
 
70
-	public function setInline($value=true){
70
+	public function setInline($value=true) {
71 71
 		$this->_params["inline"]=$value;
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function setPosition($position){
75
+	public function setPosition($position) {
76 76
 		$this->_params["position"]=$position;
77 77
 		return $this;
78 78
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
 class HtmlList extends HtmlSemCollection{
11 11
 	protected $_hasCheckedList;
12 12
 
13
+	/**
14
+	 * @param string $identifier
15
+	 */
13 16
 	public function __construct( $identifier, $items=array()){
14 17
 		parent::__construct( $identifier, "div", "ui list");
15 18
 		$this->addItems($items);
@@ -27,6 +30,9 @@  discard block
 block discarded – undo
27 30
 		return $item;
28 31
 	}
29 32
 
33
+	/**
34
+	 * @param integer $niveau
35
+	 */
30 36
 	public function addHeader($niveau,$content){
31 37
 		return $this->wrap(new HtmlHeader("header-".$this->identifier,$niveau,$content,"page"));
32 38
 	}
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,86 +7,86 @@
 block discarded – undo
7 7
 use Ajax\semantic\html\collections\form\HtmlFormCheckbox;
8 8
 use Ajax\JsUtils;
9 9
 
10
-class HtmlList extends HtmlSemCollection{
10
+class HtmlList extends HtmlSemCollection {
11 11
 	protected $_hasCheckedList;
12 12
 
13
-	public function __construct( $identifier, $items=array()){
14
-		parent::__construct( $identifier, "div", "ui list");
13
+	public function __construct($identifier, $items=array()) {
14
+		parent::__construct($identifier, "div", "ui list");
15 15
 		$this->addItems($items);
16 16
 		$this->_hasCheckedList=false;
17 17
 	}
18 18
 
19 19
 
20
-	protected function createItem($value){
20
+	protected function createItem($value) {
21 21
 		$count=$this->count();
22
-		if(\is_array($value)){
22
+		if (\is_array($value)) {
23 23
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
24 24
 			$item->addIcon($value[1]);
25 25
 		}else
26
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
26
+			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
27 27
 		return $item;
28 28
 	}
29 29
 
30
-	public function addHeader($niveau,$content){
31
-		return $this->wrap(new HtmlHeader("header-".$this->identifier,$niveau,$content,"page"));
30
+	public function addHeader($niveau, $content) {
31
+		return $this->wrap(new HtmlHeader("header-".$this->identifier, $niveau, $content, "page"));
32 32
 	}
33 33
 
34
-	public function itemsAs($tagName){
34
+	public function itemsAs($tagName) {
35 35
 		return $this->contentAs($tagName);
36 36
 	}
37 37
 
38
-	public function asLink(){
38
+	public function asLink() {
39 39
 		$this->addToPropertyCtrl("class", "link", array("link"));
40 40
 		return $this->contentAs("a");
41 41
 	}
42 42
 
43
-	public function addList($items=array()){
44
-		$list=new HtmlList("",$items);
43
+	public function addList($items=array()) {
44
+		$list=new HtmlList("", $items);
45 45
 		$list->setClass("list");
46 46
 		return $this->addItem($list);
47 47
 	}
48 48
 
49
-	public function setCelled(){
49
+	public function setCelled() {
50 50
 		return $this->addToProperty("class", "celled");
51 51
 	}
52 52
 
53
-	public function run(JsUtils $js){
54
-		if($this->_hasCheckedList===true){
53
+	public function run(JsUtils $js) {
54
+		if ($this->_hasCheckedList===true) {
55 55
 			$jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php';
56
-			$jsCode=\str_replace("%identifier%","#".$this->identifier,$jsCode);
56
+			$jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode);
57 57
 			$this->executeOnRun($jsCode);
58 58
 		}
59 59
 		return parent::run($js);
60 60
 	}
61 61
 
62
-	public function setRelaxed(){
62
+	public function setRelaxed() {
63 63
 		return $this->addToProperty("class", "relaxed");
64 64
 	}
65 65
 
66
-	public function addCheckedList($items=array(),$masterItem=NULL,$values=array()){
66
+	public function addCheckedList($items=array(), $masterItem=NULL, $values=array()) {
67 67
 		$count=$this->count();
68 68
 		$identifier=$this->identifier."-".$count;
69
-		if(isset($masterItem)){
70
-			$masterO=new HtmlFormCheckbox("master-".$identifier,$masterItem);
71
-			$masterO->getField()->addToProperty("class","master");
69
+		if (isset($masterItem)) {
70
+			$masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem);
71
+			$masterO->getField()->addToProperty("class", "master");
72 72
 			$masterO->setClass("item");
73 73
 			$this->addItem($masterO);
74 74
 		}
75 75
 		$fields=array();
76 76
 		$i=0;
77
-		foreach ($items as $val=>$caption){
78
-			$itemO=new HtmlFormCheckbox($identifier."-".$i++,$caption,$val,"child");
79
-			if(\array_search($val, $values)!==false){
77
+		foreach ($items as $val=>$caption) {
78
+			$itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child");
79
+			if (\array_search($val, $values)!==false) {
80 80
 				$itemO->getInput()->getField()->setProperty("checked", "");
81 81
 			}
82 82
 			$itemO->setClass("item");
83 83
 			$fields[]=$itemO;
84 84
 		}
85
-		if(isset($masterO)===true){
86
-			$list=new HtmlList("",$fields);
85
+		if (isset($masterO)===true) {
86
+			$list=new HtmlList("", $fields);
87 87
 			$list->setClass("list");
88 88
 			$masterO->addContent($list);
89
-		}else{
89
+		}else {
90 90
 			$this->addList($fields);
91 91
 		}
92 92
 		$this->_hasCheckedList=true;
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 		if(\is_array($value)){
23 23
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
24 24
 			$item->addIcon($value[1]);
25
-		}else
26
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
25
+		} else {
26
+					$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
27
+		}
27 28
 		return $item;
28 29
 	}
29 30
 
@@ -86,7 +87,7 @@  discard block
 block discarded – undo
86 87
 			$list=new HtmlList("",$fields);
87 88
 			$list->setClass("list");
88 89
 			$masterO->addContent($list);
89
-		}else{
90
+		} else{
90 91
 			$this->addList($fields);
91 92
 		}
92 93
 		$this->_hasCheckedList=true;
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  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 26
 			}else
27 27
 			$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$result=implode("\n", $this->jquery_code_for_compile);
33 33
 		$result=str_ireplace("\"%", "", $result);
34 34
 		$result=str_ireplace("%\"", "", $result);
35
-		$result=str_replace(array (
35
+		$result=str_replace(array(
36 36
 				"\\n",
37 37
 				"\\r",
38 38
 				"\\t"
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function getScript() {
44 44
 		$allParams=$this->params;
45
-		$this->jquery_code_for_compile=array ();
45
+		$this->jquery_code_for_compile=array();
46 46
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
47 47
 		$this->compileEvents();
48 48
 		return $this->compileJQueryCode();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		if (is_array($typeCtrl)) {
70 70
 			if (array_search($value, $typeCtrl)===false)
71 71
 				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)."}");
72
-		} else {
72
+		}else {
73 73
 			if (!$typeCtrl($value)) {
74 74
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
75 75
 			}
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  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
27
-			$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
26
+			} else {
27
+						$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
28
+			}
28 29
 		}
29 30
 	}
30 31
 
@@ -67,8 +68,9 @@  discard block
 block discarded – undo
67 68
 
68 69
 	protected function setParamCtrl($key, $value, $typeCtrl) {
69 70
 		if (is_array($typeCtrl)) {
70
-			if (array_search($value, $typeCtrl)===false)
71
-				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)."}");
71
+			if (array_search($value, $typeCtrl)===false) {
72
+							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
+			}
72 74
 		} else {
73 75
 			if (!$typeCtrl($value)) {
74 76
 				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/service/JArray.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 class JArray {
6 6
 
7 7
 	public static function isAssociative($array) {
8
-		return (array_values($array) !== $array);
8
+		return (array_values($array)!==$array);
9 9
 		//return (array_keys($array)!==range(0, count($array)-1));
10 10
 	}
11 11
 
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
 			return $values [$pos];
19 19
 	}
20 20
 
21
-	public static function getConditionalValue($array,$key,$condition){
21
+	public static function getConditionalValue($array, $key, $condition) {
22 22
 		$result=NULL;
23 23
 		if (array_key_exists($key, $array)) {
24 24
 			$result=$array [$key];
25
-			if($condition($result)===true)
25
+			if ($condition($result)===true)
26 26
 				return $result;
27 27
 		}
28 28
 		$values=array_values($array);
29
-		foreach ($values as $val){
30
-			if($condition($val)===true)
29
+		foreach ($values as $val) {
30
+			if ($condition($val)===true)
31 31
 				return $val;
32 32
 		}
33 33
 		return $result;
@@ -36,21 +36,21 @@  discard block
 block discarded – undo
36 36
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 37
 		if (array_key_exists($key, $array)) {
38 38
 			return $array [$key];
39
-		} else
39
+		}else
40 40
 			return $default;
41 41
 	}
42 42
 
43
-	public static function implode($glue,$pieces){
43
+	public static function implode($glue, $pieces) {
44 44
 		$result="";
45
-		if(\is_array($glue)){
45
+		if (\is_array($glue)) {
46 46
 			$size=\sizeof($pieces);
47
-			if($size>0){
48
-				for($i=0;$i<$size-1;$i++){
47
+			if ($size>0) {
48
+				for ($i=0; $i<$size-1; $i++) {
49 49
 					$result.=$pieces[$i].@$glue[$i];
50 50
 				}
51 51
 				$result.=$pieces[$size-1];
52 52
 			}
53
-		}else{
53
+		}else {
54 54
 			$result=\implode($glue, $pieces);
55 55
 		}
56 56
 		return $result;
Please login to merge, or discard this patch.
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,21 +14,24 @@  discard block
 block discarded – undo
14 14
 			return $array [$key];
15 15
 		}
16 16
 		$values=array_values($array);
17
-		if ($pos<sizeof($values))
18
-			return $values [$pos];
17
+		if ($pos<sizeof($values)) {
18
+					return $values [$pos];
19
+		}
19 20
 	}
20 21
 
21 22
 	public static function getConditionalValue($array,$key,$condition){
22 23
 		$result=NULL;
23 24
 		if (array_key_exists($key, $array)) {
24 25
 			$result=$array [$key];
25
-			if($condition($result)===true)
26
-				return $result;
26
+			if($condition($result)===true) {
27
+							return $result;
28
+			}
27 29
 		}
28 30
 		$values=array_values($array);
29 31
 		foreach ($values as $val){
30
-			if($condition($val)===true)
31
-				return $val;
32
+			if($condition($val)===true) {
33
+							return $val;
34
+			}
32 35
 		}
33 36
 		return $result;
34 37
 	}
@@ -36,8 +39,9 @@  discard block
 block discarded – undo
36 39
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 40
 		if (array_key_exists($key, $array)) {
38 41
 			return $array [$key];
39
-		} else
40
-			return $default;
42
+		} else {
43
+					return $default;
44
+		}
41 45
 	}
42 46
 
43 47
 	public static function implode($glue,$pieces){
@@ -50,7 +54,7 @@  discard block
 block discarded – undo
50 54
 				}
51 55
 				$result.=$pieces[$size-1];
52 56
 			}
53
-		}else{
57
+		} else{
54 58
 			$result=\implode($glue, $pieces);
55 59
 		}
56 60
 		return $result;
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlReveal.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,64 +10,64 @@
 block discarded – undo
10 10
 
11 11
 class HtmlReveal extends HtmlSemDoubleElement {
12 12
 
13
-	public function __construct($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL) {
13
+	public function __construct($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) {
14 14
 		parent::__construct($identifier, "div", "ui reveal");
15 15
 		$this->setElement(0, $visibleContent);
16 16
 		$this->setElement(1, $hiddenContent);
17
-		$this->setType($type,$attributeType);
17
+		$this->setType($type, $attributeType);
18 18
 	}
19 19
 
20
-	private function setElement($index,$content){
21
-		if(!$content instanceof HtmlSingleElement){
22
-			$content=new HtmlLabel("",$content);
20
+	private function setElement($index, $content) {
21
+		if (!$content instanceof HtmlSingleElement) {
22
+			$content=new HtmlLabel("", $content);
23 23
 		}
24
-		if($content instanceof HtmlSemDoubleElement){
25
-			$content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content);
26
-		}elseif ($content instanceof HtmlImg){
24
+		if ($content instanceof HtmlSemDoubleElement) {
25
+			$content=new HtmlSemDoubleElement($this->identifier."-".$index, "div", "", $content);
26
+		}elseif ($content instanceof HtmlImg) {
27 27
 			$this->addToPropertyCtrl("class", "image", array("image"));
28 28
 		}
29
-		$content->addToProperty("class",(($index===0)?"visible":"hidden")." content");
29
+		$content->addToProperty("class", (($index===0) ? "visible" : "hidden")." content");
30 30
 		$this->content[$index]=$content;
31 31
 		return $this;
32 32
 	}
33 33
 
34
-	public function setVisibleContent($visibleContent){
34
+	public function setVisibleContent($visibleContent) {
35 35
 		return $this->setElement(0, $visibleContent);
36 36
 	}
37 37
 
38
-	public function setHiddenContent($hiddenContent){
38
+	public function setHiddenContent($hiddenContent) {
39 39
 		return $this->setElement(1, $hiddenContent);
40 40
 	}
41 41
 
42
-	public function getVisibleContent(){
42
+	public function getVisibleContent() {
43 43
 		return $this->content[0];
44 44
 	}
45 45
 
46
-	public function getHiddenContent(){
46
+	public function getHiddenContent() {
47 47
 		return $this->content[1];
48 48
 	}
49 49
 
50
-	public function setType($type,$attribute=NULL){
50
+	public function setType($type, $attribute=NULL) {
51 51
 		$this->addToPropertyCtrl("class", $type, RevealType::getConstants());
52
-		if(isset($attribute)){
52
+		if (isset($attribute)) {
53 53
 			$this->addToPropertyCtrl("class", $attribute, Direction::getConstants());
54 54
 		}
55 55
 		return $this;
56 56
 	}
57 57
 
58
-	public function setFade($attribute=NULL){
59
-		return $this->setType(RevealType::FADE,$attribute);
58
+	public function setFade($attribute=NULL) {
59
+		return $this->setType(RevealType::FADE, $attribute);
60 60
 	}
61 61
 
62
-	public function setMove($attribute=NULL){
63
-		return $this->setType(RevealType::MOVE,$attribute);
62
+	public function setMove($attribute=NULL) {
63
+		return $this->setType(RevealType::MOVE, $attribute);
64 64
 	}
65 65
 
66
-	public function setRotate($attribute=NULL){
67
-		return $this->setType(RevealType::ROTATE,$attribute);
66
+	public function setRotate($attribute=NULL) {
67
+		return $this->setType(RevealType::ROTATE, $attribute);
68 68
 	}
69 69
 
70
-	public function setCircular(){
70
+	public function setCircular() {
71 71
 		return $this->addToProperty("class", "circular");
72 72
 	}
73 73
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 		}
24 24
 		if($content instanceof HtmlSemDoubleElement){
25 25
 			$content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content);
26
-		}elseif ($content instanceof HtmlImg){
26
+		} elseif ($content instanceof HtmlImg){
27 27
 			$this->addToPropertyCtrl("class", "image", array("image"));
28 28
 		}
29 29
 		$content->addToProperty("class",(($index===0)?"visible":"hidden")." content");
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlStep.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 use Ajax\common\html\HtmlDoubleElement;
10 10
 use Ajax\semantic\html\base\constants\Side;
11 11
 
12
-class HtmlStep extends HtmlSemCollection{
12
+class HtmlStep extends HtmlSemCollection {
13 13
 	protected $_activeStep;
14 14
 
15
-	public function __construct( $identifier,$steps=array()){
16
-		parent::__construct( $identifier,"div", "ui steps");
15
+	public function __construct($identifier, $steps=array()) {
16
+		parent::__construct($identifier, "div", "ui steps");
17 17
 		$this->addItems($steps);
18 18
 	}
19 19
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
24 24
 	 */
25 25
 	protected function createItem($value) {
26
-		$itemO=new HtmlStepItem("item-".\sizeof($this->content),$value);
26
+		$itemO=new HtmlStepItem("item-".\sizeof($this->content), $value);
27 27
 		return $itemO;
28 28
 	}
29 29
 
@@ -31,50 +31,50 @@  discard block
 block discarded – undo
31 31
 	 * @param string|array $step
32 32
 	 * @return HtmlStepItem
33 33
 	 */
34
-	public function addStep($step){
34
+	public function addStep($step) {
35 35
 		return $this->addItem($step);
36 36
 	}
37 37
 
38
-	public function setOrdered(){
38
+	public function setOrdered() {
39 39
 		return $this->addToProperty("class", "ordered");
40 40
 	}
41 41
 
42
-	public function isOrdered(){
42
+	public function isOrdered() {
43 43
 		return $this->propertyContains("class", "ordered");
44 44
 	}
45 45
 
46
-	public function setVertical(){
46
+	public function setVertical() {
47 47
 		return $this->addToProperty("class", "vertical");
48 48
 	}
49 49
 
50
-	protected function defineActiveStep(){
50
+	protected function defineActiveStep() {
51 51
 		$activestep=$this->_activeStep;
52 52
 		$count=$this->count();
53
-		if($this->isOrdered()){
54
-			for($i=0;$i<$count;$i++){
53
+		if ($this->isOrdered()) {
54
+			for ($i=0; $i<$count; $i++) {
55 55
 				$step=$this->content[$i];
56 56
 				$step->removeStatus();
57
-				if($i<$activestep)
57
+				if ($i<$activestep)
58 58
 					$step->setCompleted();
59 59
 				elseif ($i===$activestep)
60 60
 					$step->setActive();
61 61
 				else
62 62
 					$step->setDisabled();
63 63
 			}
64
-		}else{
65
-			foreach ($this->content as $step){
64
+		}else {
65
+			foreach ($this->content as $step) {
66 66
 				$step->removeStatus();
67 67
 			}
68
-			if($activestep<$count)
68
+			if ($activestep<$count)
69 69
 				$this->content[$activestep]->setActive();
70 70
 		}
71 71
 		return $this;
72 72
 	}
73 73
 
74 74
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
75
-		if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep))
75
+		if (isset($this->_activeStep)===true && \is_numeric($this->_activeStep))
76 76
 			$this->defineActiveStep();
77
-		return parent::compile($js,$view);
77
+		return parent::compile($js, $view);
78 78
 	}
79 79
 
80 80
 	public function setActiveStep($_activeStep) {
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 		return $this;
83 83
 	}
84 84
 
85
-	public function setAttached($side="",HtmlDoubleElement $toElement=NULL){
86
-		if(isset($toElement)){
87
-			$toElement->addToPropertyCtrl("class", "attached",array("attached"));
85
+	public function setAttached($side="", HtmlDoubleElement $toElement=NULL) {
86
+		if (isset($toElement)) {
87
+			$toElement->addToPropertyCtrl("class", "attached", array("attached"));
88 88
 		}
89
-		return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
89
+		return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
90 90
 	}
91 91
 
92
-	public function asLink(){
93
-		foreach ($this->content as $step){
92
+	public function asLink() {
93
+		foreach ($this->content as $step) {
94 94
 			$step->asLink();
95 95
 		}
96 96
 		return $this;
Please login to merge, or discard this patch.
Braces   +14 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,26 +54,29 @@
 block discarded – undo
54 54
 			for($i=0;$i<$count;$i++){
55 55
 				$step=$this->content[$i];
56 56
 				$step->removeStatus();
57
-				if($i<$activestep)
58
-					$step->setCompleted();
59
-				elseif ($i===$activestep)
60
-					$step->setActive();
61
-				else
62
-					$step->setDisabled();
57
+				if($i<$activestep) {
58
+									$step->setCompleted();
59
+				} elseif ($i===$activestep) {
60
+									$step->setActive();
61
+				} else {
62
+									$step->setDisabled();
63
+				}
63 64
 			}
64
-		}else{
65
+		} else{
65 66
 			foreach ($this->content as $step){
66 67
 				$step->removeStatus();
67 68
 			}
68
-			if($activestep<$count)
69
-				$this->content[$activestep]->setActive();
69
+			if($activestep<$count) {
70
+							$this->content[$activestep]->setActive();
71
+			}
70 72
 		}
71 73
 		return $this;
72 74
 	}
73 75
 
74 76
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
75
-		if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep))
76
-			$this->defineActiveStep();
77
+		if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) {
78
+					$this->defineActiveStep();
79
+		}
77 80
 		return parent::compile($js,$view);
78 81
 	}
79 82
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 3 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@
 block discarded – undo
13 13
 	public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") {
14 14
 		parent::__construct($identifier,$tagName,"ui label");
15 15
 		$this->content=$caption;
16
-		if(isset($icon))
17
-			$this->addIcon($icon);
16
+		if(isset($icon)) {
17
+					$this->addIcon($icon);
18
+		}
18 19
 	}
19 20
 
20 21
 	/**
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,6 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlLabel extends HtmlSemDoubleElement {
12 12
 	use LabeledIconTrait;
13
+
14
+	/**
15
+	 * @param string $icon
16
+	 */
13 17
 	public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") {
14 18
 		parent::__construct($identifier,$tagName,"ui label");
15 19
 		$this->content=$caption;
@@ -18,7 +22,6 @@  discard block
 block discarded – undo
18 22
 	}
19 23
 
20 24
 	/**
21
-	 * @param string $side
22 25
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
23 26
 	 */
24 27
 	public function setPointing($value=Direction::NONE){
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlLabel extends HtmlSemDoubleElement {
12 12
 	use LabeledIconTrait;
13
-	public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") {
14
-		parent::__construct($identifier,$tagName,"ui label");
13
+	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
14
+		parent::__construct($identifier, $tagName, "ui label");
15 15
 		$this->content=$caption;
16
-		if(isset($icon))
16
+		if (isset($icon))
17 17
 			$this->addIcon($icon);
18 18
 	}
19 19
 
@@ -21,33 +21,33 @@  discard block
 block discarded – undo
21 21
 	 * @param string $side
22 22
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
23 23
 	 */
24
-	public function setPointing($value=Direction::NONE){
25
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
24
+	public function setPointing($value=Direction::NONE) {
25
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
26 26
 	}
27 27
 
28 28
 	/**
29 29
 	 * @param string $side
30 30
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
31 31
 	 */
32
-	public function toCorner($side="left"){
33
-		return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner"));
32
+	public function toCorner($side="left") {
33
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
34 34
 	}
35 35
 
36 36
 	/**
37 37
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
38 38
 	 */
39
-	public function asTag(){
39
+	public function asTag() {
40 40
 		return $this->addToProperty("class", "tag");
41 41
 	}
42 42
 
43 43
 	/**
44 44
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
45 45
 	 */
46
-	public function asLink(){
46
+	public function asLink() {
47 47
 		return $this->setTagName("a");
48 48
 	}
49 49
 
50
-	public function setBasic(){
50
+	public function setBasic() {
51 51
 		return $this->addToProperty("class", "basic");
52 52
 	}
53 53
 
@@ -58,28 +58,28 @@  discard block
 block discarded – undo
58 58
 	 * @param string $before
59 59
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
60 60
 	 */
61
-	public function addImage($src,$alt="",$before=true){
61
+	public function addImage($src, $alt="", $before=true) {
62 62
 		$this->addToProperty("class", "image");
63
-		return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before);
63
+		return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before);
64 64
 	}
65 65
 
66 66
 	/**
67 67
 	 * @param string $detail
68 68
 	 * @return \Ajax\common\html\HtmlDoubleElement
69 69
 	 */
70
-	public function addDetail($detail){
71
-		$div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName);
70
+	public function addDetail($detail) {
71
+		$div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName);
72 72
 		$div->setClass("detail");
73 73
 		$div->setContent($detail);
74 74
 		$this->addContent($div);
75 75
 		return $div;
76 76
 	}
77 77
 
78
-	public function asRibbon(){
78
+	public function asRibbon() {
79 79
 		return $this->addToPropertyCtrl("class", "ribbon", array("ribbon"));
80 80
 	}
81 81
 
82
-	public static function ribbon($identifier,$caption){
83
-		return (new HtmlLabel($identifier,$caption))->asRibbon();
82
+	public static function ribbon($identifier, $caption) {
83
+		return (new HtmlLabel($identifier, $caption))->asRibbon();
84 84
 	}
85 85
 }
86 86
\ No newline at end of file
Please login to merge, or discard this patch.