Completed
Push — master ( 781bd5...e04e71 )
by Jean-Christophe
03:39
created
Ajax/semantic/html/views/HtmlCard.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@  discard block
 block discarded – undo
16 16
 class HtmlCard extends HtmlSemDoubleElement {
17 17
 
18 18
 	public function __construct($identifier) {
19
-		parent::__construct($identifier, "div", "ui card", array ());
19
+		parent::__construct($identifier, "div", "ui card", array());
20 20
 	}
21 21
 
22 22
 	private function createContent($content, $baseClass="content") {
23 23
 		$count=\sizeof($this->content);
24
-		$result=new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content);
24
+		$result=new HtmlCardContent("content-".$count."-".$this->identifier, $content);
25 25
 		$result->setClass($baseClass);
26 26
 		return $result;
27 27
 	}
28 28
 
29 29
 	private function addElementInContent($key, $element) {
30
-		if (\array_key_exists($key, $this->content) === false) {
31
-			$this->content[$key]=array ();
30
+		if (\array_key_exists($key, $this->content)===false) {
31
+			$this->content[$key]=array();
32 32
 		}
33 33
 		$this->content[$key][]=$element;
34 34
 		return $element;
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
 
37 37
 	public function addHeader($header, $niveau=4, $type="page") {
38 38
 		if (!$header instanceof HtmlHeader) {
39
-			$header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type);
39
+			$header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type);
40 40
 		}
41 41
 		$this->content["header"]=$this->createContent($header);
42 42
 	}
43 43
 
44 44
 	public function addImage($image, $title="") {
45 45
 		if (!$image instanceof HtmlImage) {
46
-			$image=new HtmlImage("image-" . $this->identifier, $image, $title);
46
+			$image=new HtmlImage("image-".$this->identifier, $image, $title);
47 47
 		}
48 48
 		$image->setClass("image");
49 49
 		return $this->addElementInContent("content", $image);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) {
53 53
 		$reveal=$visibleContent;
54 54
 		if (!$visibleContent instanceof HtmlReveal) {
55
-			$reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
55
+			$reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
56 56
 		}
57 57
 		return $this->addElementInContent("content", $reveal);
58 58
 	}
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
 
79 79
 	public function addCardHeaderContent($header, $metas=array(), $description=NULL) {
80 80
 		$count=\sizeof($this->content);
81
-		return $this->addElementInContent("content", new HtmlCardHeaderContent("content-" . $count . "-" . $this->identifier, $header, $metas, $description));
81
+		return $this->addElementInContent("content", new HtmlCardHeaderContent("content-".$count."-".$this->identifier, $header, $metas, $description));
82 82
 	}
83 83
 
84 84
 	public function addCardContent($content=array()) {
85 85
 		$count=\sizeof($this->content);
86
-		return $this->addElementInContent("content", new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content));
86
+		return $this->addElementInContent("content", new HtmlCardContent("content-".$count."-".$this->identifier, $content));
87 87
 	}
88 88
 
89 89
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
94 94
 	 */
95 95
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
96
-		$this->content=JArray::sortAssociative($this->content, [ "header","image","content","extra-content" ]);
96
+		$this->content=JArray::sortAssociative($this->content, ["header", "image", "content", "extra-content"]);
97 97
 		return parent::compile($js, $view);
98 98
 	}
99 99
 }
100 100
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/html/PropertyWrapper.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 			$output=$input;
13 13
 		}
14 14
 		if (is_array($input)) {
15
-			if (sizeof($input) > 0) {
16
-				if (self::containsElement($input) === false) {
15
+			if (sizeof($input)>0) {
16
+				if (self::containsElement($input)===false) {
17 17
 					$output=self::wrapStrings($input, $js, $separator=' ', $valueQuote='"');
18
-				} else {
18
+				}else {
19 19
 					$output=self::wrapObjects($input, $js, $separator, $valueQuote);
20 20
 				}
21 21
 			}
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	private static function containsElement($input) {
27
-		foreach ( $input as $v ) {
28
-			if (\is_object($v) === true || \is_array($v))
27
+		foreach ($input as $v) {
28
+			if (\is_object($v)===true || \is_array($v))
29 29
 				return true;
30 30
 		}
31 31
 		return false;
32 32
 	}
33 33
 
34 34
 	public static function wrapStrings($input, $js, $separator=' ', $valueQuote='"') {
35
-		if (JArray::isAssociative($input) === true) {
36
-			$result=implode($separator, array_map(function ($v, $k) use($valueQuote) {
37
-				return $k . '=' . $valueQuote . $v . $valueQuote;
35
+		if (JArray::isAssociative($input)===true) {
36
+			$result=implode($separator, array_map(function($v, $k) use($valueQuote) {
37
+				return $k.'='.$valueQuote.$v.$valueQuote;
38 38
 			}, $input, array_keys($input)));
39
-		} else {
39
+		}else {
40 40
 			$result=implode($separator, array_values($input));
41 41
 		}
42 42
 		return $result;
43 43
 	}
44 44
 
45 45
 	public static function wrapObjects($input, $js=NULL, $separator=' ', $valueQuote='"') {
46
-		return implode($separator, array_map(function ($v) use($js, $separator, $valueQuote) {
46
+		return implode($separator, array_map(function($v) use($js, $separator, $valueQuote) {
47 47
 			if (is_object($v))
48 48
 				return $v->compile($js);
49 49
 			elseif (\is_array($v)) {
50 50
 				return self::wrap($v, $js, $separator, $valueQuote);
51
-			} else
51
+			}else
52 52
 				return $v;
53 53
 		}, $input));
54 54
 	}
Please login to merge, or discard this patch.
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 	private static function containsElement($input) {
27 27
 		foreach ( $input as $v ) {
28
-			if (\is_object($v) === true || \is_array($v))
29
-				return true;
28
+			if (\is_object($v) === true || \is_array($v)) {
29
+							return true;
30
+			}
30 31
 		}
31 32
 		return false;
32 33
 	}
@@ -44,12 +45,13 @@  discard block
 block discarded – undo
44 45
 
45 46
 	public static function wrapObjects($input, $js=NULL, $separator=' ', $valueQuote='"') {
46 47
 		return implode($separator, array_map(function ($v) use($js, $separator, $valueQuote) {
47
-			if (is_object($v))
48
-				return $v->compile($js);
49
-			elseif (\is_array($v)) {
48
+			if (is_object($v)) {
49
+							return $v->compile($js);
50
+			} elseif (\is_array($v)) {
50 51
 				return self::wrap($v, $js, $separator, $valueQuote);
51
-			} else
52
-				return $v;
52
+			} else {
53
+							return $v;
54
+			}
53 55
 		}, $input));
54 56
 	}
55 57
 }
56 58
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/Semantic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
 use Ajax\semantic\traits\SemanticHtmlViewsTrait;
25 25
 
26 26
 class Semantic extends BaseGui {
27
-	use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait,
28
-	SemanticHtmlModulesTrait,SemanticHtmlViewsTrait;
27
+	use SemanticComponentsTrait, SemanticHtmlElementsTrait, SemanticHtmlCollectionsTrait,
28
+	SemanticHtmlModulesTrait, SemanticHtmlViewsTrait;
29 29
 
30 30
 	public function __construct($autoCompile=true) {
31 31
 		parent::__construct($autoCompile=true);
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/content/HtmlMenuItem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 
17 17
 	public function addIcon($icon, $before=true) {
18 18
 		$content=$this->content;
19
-		$this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content");
19
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
20 20
 		$this->content->setContent($content);
21
-		$this->content->addContent(new HtmlIcon("icon" . $this->identifier, $icon), $before);
21
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), $before);
22 22
 	}
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 
17 17
 	public function addIcon($icon, $before=true) {
18 18
 		$content=$this->content;
19
-		$this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content");
19
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
20 20
 		$this->content->setContent($content);
21
-		$this->content->addContent(new HtmlIcon("icon" . $this->identifier, $icon), $before);
21
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), $before);
22 22
 	}
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.