Passed
Push — master ( 96c921...222b0d )
by Jean-Christophe
02:00
created
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
  * @version 1.001
17 17
  */
18 18
 class HtmlMessage extends HtmlSemDoubleElement {
19
-	use AttachedTrait,HasTimeoutTrait;
19
+	use AttachedTrait, HasTimeoutTrait;
20 20
 
21 21
 	protected $icon;
22 22
 
23 23
 	protected $close;
24 24
 
25
-	public function __construct($identifier, $content = "") {
25
+	public function __construct($identifier, $content="") {
26 26
 		parent::__construct($identifier, "div");
27
-		$this->_template = '<%tagName% id="%identifier%" %properties%>%close%%icon%%wrapContentBefore%%content%%wrapContentAfter%</%tagName%>';
27
+		$this->_template='<%tagName% id="%identifier%" %properties%>%close%%icon%%wrapContentBefore%%content%%wrapContentAfter%</%tagName%>';
28 28
 		$this->setClass("ui message");
29 29
 		$this->setContent($content);
30 30
 	}
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 * @return \Ajax\semantic\html\collections\HtmlMessage
37 37
 	 */
38 38
 	public function addHeader($header) {
39
-		$headerO = $header;
39
+		$headerO=$header;
40 40
 		if (\is_string($header)) {
41
-			$headerO = new HtmlSemDoubleElement("header-" . $this->identifier, "div");
41
+			$headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div");
42 42
 			$headerO->setClass("header");
43 43
 			$headerO->setContent($header);
44 44
 		}
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 		$this->addToProperty("class", "icon");
54 54
 		$this->wrapContent("<div class='content'>", "</div>");
55 55
 		if (\is_string($icon)) {
56
-			$this->icon = new HtmlIcon("icon-" . $this->identifier, $icon);
56
+			$this->icon=new HtmlIcon("icon-".$this->identifier, $icon);
57 57
 		} else {
58
-			$this->icon = $icon;
58
+			$this->icon=$icon;
59 59
 		}
60 60
 		return $this;
61 61
 	}
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false)
73 73
 	 * @return $this
74 74
 	 */
75
-	public function getOnClose($url, $responseElement = "", $parameters = array()) {
75
+	public function getOnClose($url, $responseElement="", $parameters=array()) {
76 76
 		if (isset($this->close)) {
77 77
 			$this->close->getOnClick($url, $responseElement, $parameters);
78 78
 		}
79 79
 	}
80 80
 
81
-	public function addLoader($loaderIcon = "notched circle") {
81
+	public function addLoader($loaderIcon="notched circle") {
82 82
 		$this->setIcon($loaderIcon);
83 83
 		$this->icon->addToIcon("loading");
84 84
 		return $this;
85 85
 	}
86 86
 
87
-	public function setDismissable($dismiss = true) {
88
-		if ($dismiss === true)
89
-			$this->close = new HtmlIcon("close-" . $this->identifier, "close");
87
+	public function setDismissable($dismiss=true) {
88
+		if ($dismiss===true)
89
+			$this->close=new HtmlIcon("close-".$this->identifier, "close");
90 90
 		else
91
-			$this->close = NULL;
91
+			$this->close=NULL;
92 92
 		return $this;
93 93
 	}
94 94
 
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
99 99
 	 */
100 100
 	public function run(JsUtils $js) {
101
-		if (! isset($this->_bsComponent)) {
101
+		if (!isset($this->_bsComponent)) {
102 102
 			if (isset($this->close)) {
103
-				$js->execOn("click", "#" . $this->identifier . " .close", "$(this).closest('.message').transition({$this->_closeTransition}).trigger('close-message');");
103
+				$js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition}).trigger('close-message');");
104 104
 			}
105 105
 			if (isset($this->_timeout)) {
106 106
 				$js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}).trigger('close-message'); }, {$this->_timeout});", true);
@@ -109,15 +109,15 @@  discard block
 block discarded – undo
109 109
 		return parent::run($js);
110 110
 	}
111 111
 
112
-	public function setState($visible = true) {
113
-		$visible = ($visible === true) ? "visible" : "hidden";
112
+	public function setState($visible=true) {
113
+		$visible=($visible===true) ? "visible" : "hidden";
114 114
 		return $this->addToPropertyCtrl("class", $visible, array(
115 115
 			"visible",
116 116
 			"hidden"
117 117
 		));
118 118
 	}
119 119
 
120
-	public function setVariation($value = "floating") {
120
+	public function setVariation($value="floating") {
121 121
 		return $this->addToPropertyCtrl("class", $value, array(
122 122
 			"floating",
123 123
 			"compact"
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 	public function setMessage($message) {
140 140
 		if (\is_array($this->content)) {
141
-			$this->content[\sizeof($this->content) - 1] = $message;
141
+			$this->content[\sizeof($this->content)-1]=$message;
142 142
 		} else
143 143
 			$this->setContent($message);
144 144
 	}
Please login to merge, or discard this patch.