Completed
Push — master ( 31e9c1...1c96b8 )
by Jean-Christophe
02:56
created
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
  * @version 1.001
19 19
  */
20 20
 class HtmlSegment extends HtmlSemDoubleElement {
21
-	use AttachedTrait,TextAlignmentTrait;
21
+	use AttachedTrait, TextAlignmentTrait;
22 22
 
23 23
 	public function __construct($identifier, $content="") {
24 24
 		parent::__construct($identifier, "div", "ui segment");
25
-		$this->_variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]);
26
-		$this->_states=\array_merge($this->_states, [ State::LOADING ]);
25
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
26
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
27 27
 		$this->content=$content;
28 28
 	}
29 29
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	public function setSens($sens="vertical") {
40
-		return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" ));
40
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
41 41
 	}
42 42
 
43 43
 	public function setEmphasis($value=Emphasis::SECONDARY) {
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	public function asContainer() {
64
-		return $this->addToPropertyCtrl("class", "container", array ("container" ));
64
+		return $this->addToPropertyCtrl("class", "container", array("container"));
65 65
 	}
66 66
 
67
-	public function addGrid($numRows=1, $numCols=NULL){
68
-		$grid=new HtmlGrid("Grid-".$this->identifier,$numRows,$numCols);
67
+	public function addGrid($numRows=1, $numCols=NULL) {
68
+		$grid=new HtmlGrid("Grid-".$this->identifier, $numRows, $numCols);
69 69
 		$this->content=$grid;
70 70
 		return $grid;
71 71
 	}
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
@@ -12,8 +12,9 @@  discard block
 block discarded – undo
12 12
 		$image=new HtmlImg("img-", $src, $alt);
13 13
 		$image->setClass("");
14 14
 		parent::__construct($identifier, "div", "ui image", $image);
15
-		if (isset($size))
16
-			$this->setSize($size);
15
+		if (isset($size)) {
16
+					$this->setSize($size);
17
+		}
17 18
 	}
18 19
 
19 20
 	public function setCircular() {
@@ -21,8 +22,9 @@  discard block
 block discarded – undo
21 22
 	}
22 23
 
23 24
 	public function asAvatar($caption=NULL) {
24
-		if (isset($caption))
25
-			$this->wrap("", $caption);
25
+		if (isset($caption)) {
26
+					$this->wrap("", $caption);
27
+		}
26 28
 		return $this->addToProperty("class", "avatar");
27 29
 	}
28 30
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabelGroups.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class HtmlLabelGroups extends HtmlSemCollection {
17 17
 
18
-	public function __construct($identifier,$labels=array(), $attributes=array()) {
18
+	public function __construct($identifier, $labels=array(), $attributes=array()) {
19 19
 		parent::__construct($identifier, "div", "ui labels");
20
-		$this->_states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]);
20
+		$this->_states=\array_merge(Size::getConstants(), Color::getConstants(), ["tag", "circular"]);
21 21
 		$this->addItems($labels);
22 22
 		$this->setStates($attributes);
23 23
 	}
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 			$icon=JArray::getValue($value, "icon", 1);
32 32
 			$tagName=JArray::getValue($value, "tagName", 2);
33 33
 		}
34
-		$labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName);
34
+		$labelO=new HtmlLabel("label-".$this->identifier, $caption, $icon, $tagName);
35 35
 		return $labelO;
36 36
 	}
37 37
 
38 38
 	protected function createCondition($value) {
39
-		return ($value instanceof HtmlLabel) === false;
39
+		return ($value instanceof HtmlLabel)===false;
40 40
 	}
41 41
 
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/html5/HtmlImg.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 	}
15 15
 
16 16
 	public function asAvatar($caption=NULL) {
17
-		if (isset($caption))
18
-			$this->wrap("", $caption);
17
+		if (isset($caption)) {
18
+					$this->wrap("", $caption);
19
+		}
19 20
 			return $this->addToProperty("class", "avatar");
20 21
 	}
21 22
 }
22 23
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/html5/HtmlLink.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 	 * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run()
22 22
 	 */
23 23
 	public function run(JsUtils $js) {
24
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
24
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
25 25
 		$this->addEventsOnRun($js);
26 26
 		return $this->_bsComponent;
27 27
 	}
28 28
 
29 29
 	public function addIcon($icon, $before=true) {
30
-		return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
30
+		return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before);
31 31
 	}
32 32
 
33 33
 	public static function icon($identifier, $icon, $href="#", $label=NULL) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlDivider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
23 23
 	 */
24 24
 	public function setVertical() {
25
-		return $this->addToPropertyCtrl("class", "vertical", array ("vertical","horizontal" ));
25
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical", "horizontal"));
26 26
 	}
27 27
 
28 28
 	/**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
31 31
 	 */
32 32
 	public function setHorizontal() {
33
-		return $this->addToPropertyCtrl("class", "horizontal", array ("vertical","horizontal" ));
33
+		return $this->addToPropertyCtrl("class", "horizontal", array("vertical", "horizontal"));
34 34
 	}
35 35
 
36 36
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIcon.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return \Ajax\semantic\html\HtmlIcon
69 69
 	 */
70 70
 	public function setFlipped($sens="horizontally") {
71
-		return $this->addToProperty("class", "flipped " . $sens);
71
+		return $this->addToProperty("class", "flipped ".$sens);
72 72
 	}
73 73
 
74 74
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @return \Ajax\semantic\html\HtmlIcon
78 78
 	 */
79 79
 	public function setRotated($sens="clockwise") {
80
-		return $this->addToProperty("class", "rotated " . $sens);
80
+		return $this->addToProperty("class", "rotated ".$sens);
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function asLink($href=NULL) {
88 88
 		if (isset($href)) {
89
-			$this->wrap("<a href='" . $href . "'>", "</a>");
89
+			$this->wrap("<a href='".$href."'>", "</a>");
90 90
 		}
91 91
 		return $this->addToProperty("class", "link");
92 92
 	}
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function setBordered($inverted=false) {
104 104
 		$invertedStr="";
105
-		if ($inverted !== false)
105
+		if ($inverted!==false)
106 106
 			$invertedStr=" inverted";
107
-		return $this->addToProperty("class", "bordered" . $invertedStr);
107
+		return $this->addToProperty("class", "bordered".$invertedStr);
108 108
 	}
109 109
 
110 110
 	/**
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 
118 118
 	public function addLabel($label, $before=false, $icon=NULL) {
119
-		if($before)
119
+		if ($before)
120 120
 			$this->wrap($label);
121 121
 		else
122 122
 			$this->wrap("", $label);
123
-		if(isset($icon))
123
+		if (isset($icon))
124 124
 			$this->addToIcon($icon);
125 125
 		return $this;
126 126
 	}
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -102,8 +102,9 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function setBordered($inverted=false) {
104 104
 		$invertedStr="";
105
-		if ($inverted !== false)
106
-			$invertedStr=" inverted";
105
+		if ($inverted !== false) {
106
+					$invertedStr=" inverted";
107
+		}
107 108
 		return $this->addToProperty("class", "bordered" . $invertedStr);
108 109
 	}
109 110
 
@@ -116,12 +117,14 @@  discard block
 block discarded – undo
116 117
 	}
117 118
 
118 119
 	public function addLabel($label, $before=false, $icon=NULL) {
119
-		if($before)
120
-			$this->wrap($label);
121
-		else
122
-			$this->wrap("", $label);
123
-		if(isset($icon))
124
-			$this->addToIcon($icon);
120
+		if($before) {
121
+					$this->wrap($label);
122
+		} else {
123
+					$this->wrap("", $label);
124
+		}
125
+		if(isset($icon)) {
126
+					$this->addToIcon($icon);
127
+		}
125 128
 		return $this;
126 129
 	}
127 130
 
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 4 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=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=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.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\service\JArray;
8
-
9 8
 use Ajax\semantic\html\base\constants\State;
10 9
 
11 10
 class HtmlProgress extends HtmlSemDoubleElement {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -13,6 +13,9 @@
 block discarded – undo
13 13
  */
14 14
 class HtmlIconGroups extends HtmlSemCollection {
15 15
 
16
+	/**
17
+	 * @param string $identifier
18
+	 */
16 19
 	public function __construct($identifier, $icons=array(), $size="") {
17 20
 		parent::__construct($identifier, "i", "icons");
18 21
 		$this->addItems($icons);
Please login to merge, or discard this patch.