Completed
Push — master ( 424d4e...c1a616 )
by Jean-Christophe
03:24
created
Ajax/common/components/GenericComponent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 	 * @see \Ajax\bootstrap\components\SimpleBsComponent::getScript()
10 10
 	 */
11 11
 	public function getScript() {
12
-		$this->jquery_code_for_compile=array ();
13
-		foreach ( $this->jsCodes as $jsCode ) {
14
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
12
+		$this->jquery_code_for_compile=array();
13
+		foreach ($this->jsCodes as $jsCode) {
14
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
15 15
 					"identifier" => $this->attachTo 
16 16
 			));
17 17
 		}
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  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 ) {
23
+		foreach ($this->events as $event => $jsCode) {
24 24
 			$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
25 25
 		}
26 26
 	}
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		$result=implode("\n", $this->jquery_code_for_compile);
30 30
 		$result=str_ireplace("\"%", "", $result);
31 31
 		$result=str_ireplace("%\"", "", $result);
32
-		$result=str_replace(array (
32
+		$result=str_replace(array(
33 33
 				"\\n",
34 34
 				"\\r",
35 35
 				"\\t" 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function getScript() {
41 41
 		$allParams=$this->params;
42
-		$this->jquery_code_for_compile=array ();
42
+		$this->jquery_code_for_compile=array();
43 43
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
44 44
 		$this->compileEvents();
45 45
 		return $this->compileJQueryCode();
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		if (is_array($typeCtrl)) {
67 67
 			if (array_search($value, $typeCtrl)===false)
68 68
 				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)."}");
69
-		} else {
69
+		}else {
70 70
 			if (!$typeCtrl($value)) {
71 71
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
72 72
 			}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@
 block discarded – undo
64 64
 
65 65
 	protected function setParamCtrl($key, $value, $typeCtrl) {
66 66
 		if (is_array($typeCtrl)) {
67
-			if (array_search($value, $typeCtrl)===false)
68
-				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)."}");
67
+			if (array_search($value, $typeCtrl)===false) {
68
+							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)."}");
69
+			}
69 70
 		} else {
70 71
 			if (!$typeCtrl($value)) {
71 72
 				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/semantic/html/base/HtmlSemDoubleElement.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,8 +41,9 @@  discard block
 block discarded – undo
41 41
 	}
42 42
 
43 43
 	public function setPopupAttributes($variation=NULL,$popupEvent=NULL){
44
-		if(isset($this->_popup))
45
-			$this->_popup->setAttributes($variation,$popupEvent);
44
+		if(isset($this->_popup)) {
45
+					$this->_popup->setAttributes($variation,$popupEvent);
46
+		}
46 47
 	}
47 48
 
48 49
 	public function addPopup($title="",$content="",$variation=NULL,$params=array()){
@@ -82,8 +83,9 @@  discard block
 block discarded – undo
82 83
 	}
83 84
 
84 85
 	public function compile(JsUtils $js=NULL, View $view=NULL){
85
-		if(isset($this->_popup))
86
-			$this->_popup->compile();
86
+		if(isset($this->_popup)) {
87
+					$this->_popup->compile();
88
+		}
87 89
 		return parent::compile($js,$view);
88 90
 	}
89 91
 	public function run(JsUtils $js){
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	use BaseTrait;
18 18
 	protected $_popup=NULL;
19 19
 
20
-	public function __construct($identifier, $tagName="p",$baseClass="ui",$content=NULL) {
20
+	public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) {
21 21
 		parent::__construct($identifier, $tagName);
22 22
 		$this->_baseClass=$baseClass;
23 23
 		$this->setClass($baseClass);
24
-		if(isset($content)){
24
+		if (isset($content)) {
25 25
 			$this->content=$content;
26 26
 		}
27 27
 	}
28 28
 
29
-	public function setPopupAttributes($variation=NULL,$popupEvent=NULL){
30
-		if(isset($this->_popup))
31
-			$this->_popup->setAttributes($variation,$popupEvent);
29
+	public function setPopupAttributes($variation=NULL, $popupEvent=NULL) {
30
+		if (isset($this->_popup))
31
+			$this->_popup->setAttributes($variation, $popupEvent);
32 32
 	}
33 33
 
34
-	public function addPopup($title="",$content="",$variation=NULL,$params=array()){
35
-		$this->_popup=new InternalPopup($this,$title,$content,$variation,$params);
34
+	public function addPopup($title="", $content="", $variation=NULL, $params=array()) {
35
+		$this->_popup=new InternalPopup($this, $title, $content, $variation, $params);
36 36
 		return $this;
37 37
 	}
38 38
 
39
-	public function addPopupHtml($html="",$variation=NULL,$params=array()){
39
+	public function addPopupHtml($html="", $variation=NULL, $params=array()) {
40 40
 		$this->_popup=new InternalPopup($this);
41 41
 		$this->_popup->setHtml($html);
42
-		$this->_popup->setAttributes($variation,$params);
42
+		$this->_popup->setAttributes($variation, $params);
43 43
 		return $this;
44 44
 	}
45 45
 
46
-	public function compile(JsUtils $js=NULL, View $view=NULL){
47
-		if(isset($this->_popup))
46
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
47
+		if (isset($this->_popup))
48 48
 			$this->_popup->compile();
49
-		return parent::compile($js,$view);
49
+		return parent::compile($js, $view);
50 50
 	}
51
-	public function run(JsUtils $js){
51
+	public function run(JsUtils $js) {
52 52
 		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
53 53
 		parent::run($js);
54 54
 		$this->addEventsOnRun($js);
55
-		if(isset($this->_popup)){
55
+		if (isset($this->_popup)) {
56 56
 			$this->_popup->run($js);
57 57
 		}
58 58
 		return $this->_bsComponent;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/InternalPopup.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 	protected $variation;
12 12
 	protected $params;
13 13
 	protected $semElement;
14
-	public function __construct($semElement,$title="",$content="",$variation=NULL,$params=array()){
14
+	public function __construct($semElement, $title="", $content="", $variation=NULL, $params=array()) {
15 15
 		$this->semElement=$semElement;
16 16
 		$this->title=$title;
17 17
 		$this->content=$content;
18
-		$this->setAttributes($variation,$params);
18
+		$this->setAttributes($variation, $params);
19 19
 	}
20 20
 
21 21
 	public function setHtml($html) {
@@ -23,32 +23,32 @@  discard block
 block discarded – undo
23 23
 		return $this;
24 24
 	}
25 25
 
26
-	public function setAttributes($variation=NULL,$params=array()){
26
+	public function setAttributes($variation=NULL, $params=array()) {
27 27
 		$this->variation=$variation;
28 28
 		$this->params=$params;
29 29
 	}
30 30
 
31
-	public function onShow($jsCode){
31
+	public function onShow($jsCode) {
32 32
 		$this->params["onShow"]=$jsCode;
33 33
 	}
34 34
 
35
-	public function compile(){
36
-		if(JString::isNotNull($this->title)){
35
+	public function compile() {
36
+		if (JString::isNotNull($this->title)) {
37 37
 			$this->semElement->addToProperty("data-title", $this->title);
38 38
 		}
39
-		if(JString::isNotNull($this->content)){
39
+		if (JString::isNotNull($this->content)) {
40 40
 			$this->semElement->addToProperty("data-content", $this->content);
41 41
 		}
42
-		if(JString::isNotNull($this->html)){
42
+		if (JString::isNotNull($this->html)) {
43 43
 			$this->semElement->addToProperty("data-html", $this->html);
44 44
 		}
45
-		if(JString::isNotNull($this->variation)){
45
+		if (JString::isNotNull($this->variation)) {
46 46
 			$this->semElement->addToProperty("data-variation", $this->variation);
47 47
 		}
48 48
 	}
49 49
 
50
-	public function run(JsUtils $js){
51
-		$js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params);
50
+	public function run(JsUtils $js) {
51
+		$js->semantic()->popup("#".$this->semElement->getIdentifier(), $this->params);
52 52
 	}
53 53
 
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlDropdownItem.php 3 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -10,30 +10,30 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlDropdownItem extends HtmlSemDoubleElement {
12 12
 
13
-	public function __construct($identifier, $content="",$value=NULL,$image=NULL) {
13
+	public function __construct($identifier, $content="", $value=NULL, $image=NULL) {
14 14
 		parent::__construct($identifier, "div");
15 15
 		$this->setClass("item");
16 16
 		$this->setContent($content);
17
-		if($value!==NULL)
17
+		if ($value!==NULL)
18 18
 			$this->setData($value);
19
-		if($image!==NULL)
19
+		if ($image!==NULL)
20 20
 			$this->asMiniAvatar($image);
21 21
 	}
22 22
 
23
-	public function setDescription($description){
24
-		$descO=new HtmlDoubleElement("desc-".$this->identifier,"span");
23
+	public function setDescription($description) {
24
+		$descO=new HtmlDoubleElement("desc-".$this->identifier, "span");
25 25
 		$descO->setClass("description");
26 26
 		$descO->setContent($description);
27
-		return $this->addContent($descO,true);
27
+		return $this->addContent($descO, true);
28 28
 	}
29 29
 
30
-	public function setData($value){
30
+	public function setData($value) {
31 31
 		$this->setProperty("data-value", $value);
32 32
 	}
33 33
 
34
-	public function asOption(){
34
+	public function asOption() {
35 35
 		$this->tagName="option";
36
-		if($this->getProperty("data-value")!==null)
36
+		if ($this->getProperty("data-value")!==null)
37 37
 			$this->setProperty("value", $this->getProperty("data-value"));
38 38
 	}
39 39
 
@@ -41,58 +41,58 @@  discard block
 block discarded – undo
41 41
 	 * @param string $image the image src
42 42
 	 * @return \Ajax\common\html\html5\HtmlImg
43 43
 	 */
44
-	public function asMiniAvatar($image){
44
+	public function asMiniAvatar($image) {
45 45
 		$this->tagName="div";
46
-		$img=new HtmlImg("image-".$this->identifier,$image);
46
+		$img=new HtmlImg("image-".$this->identifier, $image);
47 47
 		$img->setClass("ui mini avatar image");
48
-		$this->addContent($img,true);
48
+		$this->addContent($img, true);
49 49
 		return $img;
50 50
 	}
51 51
 
52
-	public function asSearchInput($placeholder=NULL,$icon=NULL){
52
+	public function asSearchInput($placeholder=NULL, $icon=NULL) {
53 53
 		$this->setClass("ui icon search input");
54 54
 		$input=new HtmlInput("search-".$this->identifier);
55
-		if(isset($placeholder))
55
+		if (isset($placeholder))
56 56
 			$input->setProperty("placeholder", $placeholder);
57 57
 		$this->content=$input;
58
-		if(isset($icon))
58
+		if (isset($icon))
59 59
 			$this->addIcon($icon);
60 60
 		return $this;
61 61
 	}
62 62
 
63
-	public function setContent($content){
64
-		if($content==="-"){
63
+	public function setContent($content) {
64
+		if ($content==="-") {
65 65
 			$this->asDivider();
66
-		}elseif($content==="-search-"){
67
-			$values=\explode(",",$content,-1);
68
-			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search"));
66
+		}elseif ($content==="-search-") {
67
+			$values=\explode(",", $content, -1);
68
+			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."), JArray::getDefaultValue($values, 1, "search"));
69 69
 		}else
70 70
 			parent::setContent($content);
71 71
 		return $this;
72 72
 	}
73 73
 
74
-	public function asDivider(){
74
+	public function asDivider() {
75 75
 		$this->content=NULL;
76 76
 		$this->setClass("divider");
77 77
 	}
78 78
 
79
-	public function asHeader($caption=NULL,$icon=NULL){
79
+	public function asHeader($caption=NULL, $icon=NULL) {
80 80
 		$this->setClass("header");
81 81
 		$this->content=$caption;
82
-		if(isset($icon))
83
-			$this->addIcon($icon,true);
82
+		if (isset($icon))
83
+			$this->addIcon($icon, true);
84 84
 		return $this;
85 85
 	}
86 86
 
87
-	public static function searchInput($placeholder=NULL,$icon=NULL){
88
-		return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon);
87
+	public static function searchInput($placeholder=NULL, $icon=NULL) {
88
+		return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon);
89 89
 	}
90 90
 
91
-	public static function divider($placeholder=NULL,$icon=NULL){
91
+	public static function divider($placeholder=NULL, $icon=NULL) {
92 92
 		return (new HtmlDropdownItem(""))->asDivider();
93 93
 	}
94 94
 
95
-	public static function header($caption=NULL,$icon=NULL){
96
-		return (new HtmlDropdownItem(""))->asHeader($caption,$icon);
95
+	public static function header($caption=NULL, $icon=NULL) {
96
+		return (new HtmlDropdownItem(""))->asHeader($caption, $icon);
97 97
 	}
98 98
 }
99 99
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +22 added lines, -15 removed lines patch added patch discarded remove patch
@@ -14,10 +14,12 @@  discard block
 block discarded – undo
14 14
 		parent::__construct($identifier, "div");
15 15
 		$this->setClass("item");
16 16
 		$this->setContent($content);
17
-		if($value!==NULL)
18
-			$this->setData($value);
19
-		if($image!==NULL)
20
-			$this->asMiniAvatar($image);
17
+		if($value!==NULL) {
18
+					$this->setData($value);
19
+		}
20
+		if($image!==NULL) {
21
+					$this->asMiniAvatar($image);
22
+		}
21 23
 	}
22 24
 
23 25
 	public function setDescription($description){
@@ -33,8 +35,9 @@  discard block
 block discarded – undo
33 35
 
34 36
 	public function asOption(){
35 37
 		$this->tagName="option";
36
-		if($this->getProperty("data-value")!==null)
37
-			$this->setProperty("value", $this->getProperty("data-value"));
38
+		if($this->getProperty("data-value")!==null) {
39
+					$this->setProperty("value", $this->getProperty("data-value"));
40
+		}
38 41
 	}
39 42
 
40 43
 	/**
@@ -52,22 +55,25 @@  discard block
 block discarded – undo
52 55
 	public function asSearchInput($placeholder=NULL,$icon=NULL){
53 56
 		$this->setClass("ui icon search input");
54 57
 		$input=new HtmlInput("search-".$this->identifier);
55
-		if(isset($placeholder))
56
-			$input->setProperty("placeholder", $placeholder);
58
+		if(isset($placeholder)) {
59
+					$input->setProperty("placeholder", $placeholder);
60
+		}
57 61
 		$this->content=$input;
58
-		if(isset($icon))
59
-			$this->addIcon($icon);
62
+		if(isset($icon)) {
63
+					$this->addIcon($icon);
64
+		}
60 65
 		return $this;
61 66
 	}
62 67
 
63 68
 	public function setContent($content){
64 69
 		if($content==="-"){
65 70
 			$this->asDivider();
66
-		}elseif($content==="-search-"){
71
+		} elseif($content==="-search-"){
67 72
 			$values=\explode(",",$content,-1);
68 73
 			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search"));
69
-		}else
70
-			parent::setContent($content);
74
+		} else {
75
+					parent::setContent($content);
76
+		}
71 77
 		return $this;
72 78
 	}
73 79
 
@@ -79,8 +85,9 @@  discard block
 block discarded – undo
79 85
 	public function asHeader($caption=NULL,$icon=NULL){
80 86
 		$this->setClass("header");
81 87
 		$this->content=$caption;
82
-		if(isset($icon))
83
-			$this->addIcon($icon,true);
88
+		if(isset($icon)) {
89
+					$this->addIcon($icon,true);
90
+		}
84 91
 		return $this;
85 92
 	}
86 93
 
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -11,6 +11,10 @@  discard block
 block discarded – undo
11 11
 
12 12
 class HtmlDropdownItem extends HtmlSemDoubleElement {
13 13
 	use IconTrait;
14
+
15
+	/**
16
+	 * @param string $identifier
17
+	 */
14 18
 	public function __construct($identifier, $content="",$value=NULL,$image=NULL) {
15 19
 		parent::__construct($identifier, "a");
16 20
 		$this->setClass("item");
@@ -61,6 +65,9 @@  discard block
 block discarded – undo
61 65
 		return $this;
62 66
 	}
63 67
 
68
+	/**
69
+	 * @param string $content
70
+	 */
64 71
 	public function setContent($content){
65 72
 		if($content==="-"){
66 73
 			$this->asDivider();
Please login to merge, or discard this patch.
Ajax/service/JString.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,21 +2,21 @@
 block discarded – undo
2 2
 namespace Ajax\service;
3 3
 class JString {
4 4
 
5
-	public static function contains($hay,$needle){
6
-		return strpos($hay, $needle) !== false;
5
+	public static function contains($hay, $needle) {
6
+		return strpos($hay, $needle)!==false;
7 7
 	}
8 8
 	public static function startswith($hay, $needle) {
9
-		return substr($hay, 0, strlen($needle)) === $needle;
9
+		return substr($hay, 0, strlen($needle))===$needle;
10 10
 	}
11 11
 
12 12
 	public static function endswith($hay, $needle) {
13
-		return substr($hay, -strlen($needle)) === $needle;
13
+		return substr($hay, -strlen($needle))===$needle;
14 14
 	}
15 15
 
16
-	public static function isNull($s){
16
+	public static function isNull($s) {
17 17
 		return (!isset($s) || NULL===$s || ""===$s);
18 18
 	}
19
-	public static function isNotNull($s){
19
+	public static function isNotNull($s) {
20 20
 		return (isset($s) && NULL!==$s && ""!==$s);
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlMessage.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -24,38 +24,38 @@  discard block
 block discarded – undo
24 24
 		$this->setContent($content);
25 25
 	}
26 26
 
27
-	public function addHeader($header){
27
+	public function addHeader($header) {
28 28
 		$headerO=$header;
29
-		if(\is_string($header)){
30
-			$headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div");
29
+		if (\is_string($header)) {
30
+			$headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div");
31 31
 			$headerO->setClass("header");
32 32
 			$headerO->setContent($header);
33 33
 		}
34
-		return $this->addContent($headerO,true);
34
+		return $this->addContent($headerO, true);
35 35
 	}
36 36
 
37
-	public function addList($elements,$ordered=false){
38
-		$list=new HtmlList("list-".$this->identifier,$elements);
37
+	public function addList($elements, $ordered=false) {
38
+		$list=new HtmlList("list-".$this->identifier, $elements);
39 39
 		$list->setOrdered($ordered);
40 40
 		$list->setClass("ui list");
41 41
 		$this->addContent($list);
42 42
 	}
43 43
 
44
-	public function setIcon($icon){
44
+	public function setIcon($icon) {
45 45
 		$this->addToProperty("class", "icon");
46
-		$this->wrapContent("<div class='content'>","</div>");
46
+		$this->wrapContent("<div class='content'>", "</div>");
47 47
 		$this->icon=new HtmlIcon("icon-".$this->identifier, $icon);
48 48
 		return $this;
49 49
 	}
50 50
 
51
-	public function addLoader($loaderIcon="notched circle"){
51
+	public function addLoader($loaderIcon="notched circle") {
52 52
 		$this->setIcon($loaderIcon);
53 53
 		$this->icon->addToIcon("loading");
54 54
 		return $this;
55 55
 	}
56 56
 
57
-	public function setDismissable($dismiss=true){
58
-		if($dismiss===true)
57
+	public function setDismissable($dismiss=true) {
58
+		if ($dismiss===true)
59 59
 			$this->close=new HtmlIcon("close-".$this->identifier, "close");
60 60
 		else
61 61
 			$this->close=NULL;
@@ -66,28 +66,28 @@  discard block
 block discarded – undo
66 66
 	 * {@inheritDoc}
67 67
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
68 68
 	 */
69
-	public function run(JsUtils $js){
69
+	public function run(JsUtils $js) {
70 70
 		parent::run($js);
71
-		if(isset($this->close)){
71
+		if (isset($this->close)) {
72 72
 			$js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition('fade')");
73 73
 		}
74 74
 	}
75 75
 
76
-	public function setState($visible=true){
77
-		$visible=($visible===true)?"visible":"hidden";
78
-		return $this->addToPropertyCtrl("class", $visible, array("visible","hidden"));
76
+	public function setState($visible=true) {
77
+		$visible=($visible===true) ? "visible" : "hidden";
78
+		return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden"));
79 79
 	}
80 80
 
81
-	public function setVariation($value="floating"){
82
-		return $this->addToPropertyCtrl("class", $value, array("floating","compact"));
81
+	public function setVariation($value="floating") {
82
+		return $this->addToPropertyCtrl("class", $value, array("floating", "compact"));
83 83
 	}
84 84
 
85
-	public function setStyle($style){
85
+	public function setStyle($style) {
86 86
 		return $this->addToPropertyCtrl("class", $style, Style::getConstants());
87 87
 	}
88 88
 
89
-	public function setAttached(HtmlDoubleElement $toElement=NULL){
90
-		if(isset($toElement)){
89
+	public function setAttached(HtmlDoubleElement $toElement=NULL) {
90
+		if (isset($toElement)) {
91 91
 			$toElement->addToProperty("class", "attached");
92 92
 		}
93 93
 		return $this->addToProperty("class", "attached");
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,10 +55,11 @@
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setDismissable($dismiss=true){
58
-		if($dismiss===true)
59
-			$this->close=new HtmlIcon("close-".$this->identifier, "close");
60
-		else
61
-			$this->close=NULL;
58
+		if($dismiss===true) {
59
+					$this->close=new HtmlIcon("close-".$this->identifier, "close");
60
+		} else {
61
+					$this->close=NULL;
62
+		}
62 63
 		return $this;
63 64
 	}
64 65
 
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
 		parent::__construct($identifier, "ul");
14 14
 		$this->addItems($items);
15 15
 	}
16
-	public function setOrdered($ordered=true){
17
-		$this->tagName=($ordered===true)?"ol":"ul";
16
+	public function setOrdered($ordered=true) {
17
+		$this->tagName=($ordered===true) ? "ol" : "ul";
18 18
 	}
19 19
 
20 20
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlMenu.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
 	protected $_tabsType="tabs";
21 21
 	protected $stacked="";
22 22
 
23
+	/**
24
+	 * @param string $identifier
25
+	 */
23 26
 	public function __construct($identifier, $tagName="ul") {
24 27
 		parent::__construct($identifier, $tagName);
25 28
 		$this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%";
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	 * @param string $type one of text,item
28 28
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
29 29
 	 */
30
-	public function setType($type=""){
31
-		return $this->addToPropertyCtrl("class", $type, array("","item","text"));
30
+	public function setType($type="") {
31
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
32 32
 	}
33 33
 
34
-	public function setActiveItem($index){
34
+	public function setActiveItem($index) {
35 35
 		$item=$this->getItem($index);
36
-		if($item!==null){
36
+		if ($item!==null) {
37 37
 			$item->addToProperty("class", "active");
38 38
 		}
39 39
 		return $this;
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
 	 * {@inheritDoc}
44 44
 	 * @see \Ajax\common\html\html5\HtmlCollection::addItem()
45 45
 	 */
46
-	public function addItem($item){
47
-		if($item instanceof \Ajax\semantic\html\elements\HtmlInput){
48
-			$itemO=new HtmlSemDoubleElement("item-".$this->identifier,"div");
46
+	public function addItem($item) {
47
+		if ($item instanceof \Ajax\semantic\html\elements\HtmlInput) {
48
+			$itemO=new HtmlSemDoubleElement("item-".$this->identifier, "div");
49 49
 			$itemO->setContent($item);
50 50
 			$item=$itemO;
51 51
 		}
52 52
 		$item=parent::addItem($item);
53
-		if(!$item instanceof HtmlMenu)
54
-			$item->addToPropertyCtrl("class", "item",array("item"));
55
-		else{
53
+		if (!$item instanceof HtmlMenu)
54
+			$item->addToPropertyCtrl("class", "item", array("item"));
55
+		else {
56 56
 			$this->setSecondary();
57 57
 		}
58 58
 	}
59
-	public function generateMenuAsItem($menu,$header=null){
59
+	public function generateMenuAsItem($menu, $header=null) {
60 60
 		$count=$this->count();
61
-		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"div");
62
-		if(isset($header)){
63
-			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count,"div","header");
61
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
62
+		if (isset($header)) {
63
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
64 64
 			$headerItem->setContent($header);
65 65
 			$item->addContent($headerItem);
66 66
 		}
@@ -68,59 +68,59 @@  discard block
 block discarded – undo
68 68
 		$item->addContent($menu);
69 69
 		return $item;
70 70
 	}
71
-	public function addMenuAsItem($menu,$header=null){
72
-		return $this->addItem($this->generateMenuAsItem($menu,$header));
71
+	public function addMenuAsItem($menu, $header=null) {
72
+		return $this->addItem($this->generateMenuAsItem($menu, $header));
73 73
 	}
74 74
 	/**
75 75
 	 * {@inheritDoc}
76 76
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
77 77
 	 */
78 78
 	protected function createItem($value) {
79
-		$itemO=new HtmlLink("item-".\sizeof($this->content),"",$value);
79
+		$itemO=new HtmlLink("item-".\sizeof($this->content), "", $value);
80 80
 		return $itemO->setClass("item");
81 81
 	}
82 82
 
83
-	public function setInverted(){
83
+	public function setInverted() {
84 84
 		return $this->addToProperty("class", "inverted");
85 85
 	}
86 86
 
87
-	public function setSecondary(){
87
+	public function setSecondary() {
88 88
 		return $this->addToProperty("class", "secondary");
89 89
 	}
90 90
 
91
-	public function setVertical(){
91
+	public function setVertical() {
92 92
 		return $this->addToProperty("class", "vertical");
93 93
 	}
94 94
 
95
-	public function setPosition($value="right"){
96
-		return $this->addToPropertyCtrl("class", $value,array("right","left"));
95
+	public function setPosition($value="right") {
96
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
97 97
 	}
98 98
 
99
-	public function setPointing($value=Direction::NONE){
100
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
99
+	public function setPointing($value=Direction::NONE) {
100
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
101 101
 	}
102 102
 
103
-	public function asTab($vertical=false){
104
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
105
-		if($vertical===true)
103
+	public function asTab($vertical=false) {
104
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
105
+		if ($vertical===true)
106 106
 			$this->setVertical();
107 107
 		return $this->addToProperty("class", "tabular");
108 108
 	}
109 109
 
110
-	public function asPagination(){
111
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
110
+	public function asPagination() {
111
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
112 112
 			return $this->addToProperty("class", "pagination");
113 113
 	}
114 114
 
115
-	public function setFixed(){
115
+	public function setFixed() {
116 116
 		return $this->addToProperty("class", "fixed");
117 117
 	}
118 118
 
119
-	public function setFluid(){
119
+	public function setFluid() {
120 120
 		return $this->addToProperty("class", "fluid");
121 121
 	}
122 122
 
123
-	public function setCompact(){
123
+	public function setCompact() {
124 124
 		return $this->addToProperty("class", "compact");
125 125
 	}
126 126
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function fromDatabaseObject($object, $function) {
131 131
 		$return=$function($object);
132
-		if(\is_array($return))
132
+		if (\is_array($return))
133 133
 			$this->addItems($return);
134 134
 		else
135 135
 		$this->addItem($return);
Please login to merge, or discard this patch.
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 			$item=$itemO;
51 51
 		}
52 52
 		$item=parent::addItem($item);
53
-		if(!$item instanceof HtmlMenu)
54
-			$item->addToPropertyCtrl("class", "item",array("item"));
55
-		else{
53
+		if(!$item instanceof HtmlMenu) {
54
+					$item->addToPropertyCtrl("class", "item",array("item"));
55
+		} else{
56 56
 			$this->setSecondary();
57 57
 		}
58 58
 	}
@@ -102,8 +102,9 @@  discard block
 block discarded – undo
102 102
 
103 103
 	public function asTab($vertical=false){
104 104
 		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
105
-		if($vertical===true)
106
-			$this->setVertical();
105
+		if($vertical===true) {
106
+					$this->setVertical();
107
+		}
107 108
 		return $this->addToProperty("class", "tabular");
108 109
 	}
109 110
 
@@ -129,9 +130,10 @@  discard block
 block discarded – undo
129 130
 	 */
130 131
 	public function fromDatabaseObject($object, $function) {
131 132
 		$return=$function($object);
132
-		if(\is_array($return))
133
-			$this->addItems($return);
134
-		else
135
-		$this->addItem($return);
133
+		if(\is_array($return)) {
134
+					$this->addItems($return);
135
+		} else {
136
+				$this->addItem($return);
137
+		}
136 138
 	}
137 139
 }
138 140
\ No newline at end of file
Please login to merge, or discard this patch.