Passed
Push — master ( 468e47...0bebef )
by Jean-Christophe
02:09
created
Ajax/semantic/html/modules/HtmlPopup.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 class HtmlPopup extends HtmlSemDoubleElement {
13 13
 	private $_container;
14
-	public function __construct(BaseHtml $container,$identifier, $content="") {
14
+	public function __construct(BaseHtml $container, $identifier, $content="") {
15 15
 		parent::__construct($identifier, "div");
16 16
 		$this->_container=$container;
17 17
 		$this->setClass("ui popup");
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::addList()
25 25
 	 */
26
-	public function addList($items=array(),$header=NULL){
27
-		if(!$this->content instanceof HtmlGrid){
28
-			$this->content=new HtmlGrid("Grid-".$this->identifier,0);
26
+	public function addList($items=array(), $header=NULL) {
27
+		if (!$this->content instanceof HtmlGrid) {
28
+			$this->content=new HtmlGrid("Grid-".$this->identifier, 0);
29 29
 		}
30 30
 		$grid=$this->content;
31 31
 
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 		$colCount++;
34 34
 		$grid->setColsCount($colCount);
35 35
 
36
-		$list=new HtmlList("",$items);
36
+		$list=new HtmlList("", $items);
37 37
 		$list->asLink();
38
-		if(isset($header)){
39
-			$list->addHeader(4,$header);
38
+		if (isset($header)) {
39
+			$list->addHeader(4, $header);
40 40
 		}
41
-		$grid->getCell(0,$colCount-1)->setContent($list);
41
+		$grid->getCell(0, $colCount-1)->setContent($list);
42 42
 		$grid->setDivided()->setRelaxed(true);
43 43
 		return $list;
44 44
 	}
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 	/**
47 47
 	 * A popup can have no maximum width and continue to flow to fit its content
48 48
 	 */
49
-	public function setFlowing(){
49
+	public function setFlowing() {
50 50
 		return $this->addToProperty("class", "flowing");
51 51
 	}
52 52
 
53 53
 	/**
54 54
 	 * A popup can provide more basic formatting
55 55
 	 */
56
-	public function setBasic(){
56
+	public function setBasic() {
57 57
 		return $this->addToProperty("class", "basic");
58 58
 	}
59 59
 
@@ -61,23 +61,23 @@  discard block
 block discarded – undo
61 61
 	 * {@inheritDoc}
62 62
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
63 63
 	 */
64
-	public function run(JsUtils $js){
64
+	public function run(JsUtils $js) {
65 65
 		parent::run($js);
66 66
 		$this->_params["popup"]="#".$this->identifier;
67
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params);
67
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params);
68 68
 	}
69 69
 
70
-	public function setOn($event="click"){
70
+	public function setOn($event="click") {
71 71
 		$this->_params["on"]=$event;
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function setInline($value=true){
75
+	public function setInline($value=true) {
76 76
 		$this->_params["inline"]=$value;
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setPosition($position){
80
+	public function setPosition($position) {
81 81
 		$this->_params["position"]=$position;
82 82
 		return $this;
83 83
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldTrait.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	abstract public function addToProperty($name, $value, $separator=" ");
21 21
 	abstract public function addLabel($caption, $style="label-default", $leftSeparator=" ");
22
-	abstract public function addContent($content,$before=false);
22
+	abstract public function addContent($content, $before=false);
23 23
 	abstract public function getField();
24 24
 	abstract public function getDataField();
25 25
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	}
29 29
 
30 30
 	public function addLoading() {
31
-		if ($this->_hasIcon === false) {
31
+		if ($this->_hasIcon===false) {
32 32
 			throw new \Exception("Input must have an icon for showing a loader, use addIcon before");
33 33
 		}
34 34
 		return $this->addToProperty("class", State::LOADING);
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function labeled($label, $direction=Direction::LEFT, $icon=NULL) {
44 44
 		$field=$this->getField();
45
-		$labelO=$field->addLabel($label,$direction===Direction::LEFT,$icon);
46
-		$field->addToProperty("class", $direction . " labeled");
45
+		$labelO=$field->addLabel($label, $direction===Direction::LEFT, $icon);
46
+		$field->addToProperty("class", $direction." labeled");
47 47
 		return $labelO;
48 48
 	}
49 49
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 * @param string $checkboxType
55 55
 	 * @return HtmlLabel
56 56
 	 */
57
-	public function labeledCheckbox($direction=Direction::LEFT,$caption="",$value=NULL,$checkboxType=NULL){
58
-		return $this->labeled(new HtmlCheckbox("lbl-ck-".$this->getField()->getIdentifier(),$caption,$value,$checkboxType),$direction);
57
+	public function labeledCheckbox($direction=Direction::LEFT, $caption="", $value=NULL, $checkboxType=NULL) {
58
+		return $this->labeled(new HtmlCheckbox("lbl-ck-".$this->getField()->getIdentifier(), $caption, $value, $checkboxType), $direction);
59 59
 	}
60 60
 
61 61
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 * @return HtmlLabel
65 65
 	 */
66 66
 	public function labeledToCorner($icon, $direction=Direction::LEFT) {
67
-		return $this->labeled("", $direction . " corner", $icon)->toCorner($direction);
67
+		return $this->labeled("", $direction." corner", $icon)->toCorner($direction);
68 68
 	}
69 69
 
70 70
 	/**
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 	public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $labeled=false) {
78 78
 		$field=$this->getField();
79 79
 		$actionO=$action;
80
-		if (\is_object($action) === false) {
81
-			$actionO=new HtmlButton("action-" . $this->identifier, $action);
80
+		if (\is_object($action)===false) {
81
+			$actionO=new HtmlButton("action-".$this->identifier, $action);
82 82
 			if (isset($icon))
83 83
 				$actionO->addIcon($icon, true, $labeled);
84 84
 		}
85
-		$field->addToProperty("class", $direction . " action");
86
-		$field->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
85
+		$field->addToProperty("class", $direction." action");
86
+		$field->addContent($actionO, \strstr($direction, Direction::LEFT)!==false);
87 87
 		return $actionO;
88 88
 	}
89 89
 
@@ -93,34 +93,34 @@  discard block
 block discarded – undo
93 93
 	 * @param string $direction
94 94
 	 * @return HtmlLabel
95 95
 	 */
96
-	public function addDropdown($label="", $items=array(),$direction=Direction::RIGHT){
97
-		$labelO=new HtmlDropdown("dd-".$this->identifier,$label,$items);
98
-		$labelO->asSelect("select-".$this->identifier,false,true);
99
-		return $this->labeled($labelO,$direction);
96
+	public function addDropdown($label="", $items=array(), $direction=Direction::RIGHT) {
97
+		$labelO=new HtmlDropdown("dd-".$this->identifier, $label, $items);
98
+		$labelO->asSelect("select-".$this->identifier, false, true);
99
+		return $this->labeled($labelO, $direction);
100 100
 	}
101 101
 
102 102
 	public function setTransparent() {
103 103
 		return $this->getField()->addToProperty("class", "transparent");
104 104
 	}
105 105
 
106
-	public function setReadonly(){
106
+	public function setReadonly() {
107 107
 		$this->getDataField()->setProperty("readonly", "");
108 108
 		return $this;
109 109
 	}
110 110
 
111
-	public function setName($name){
112
-		$this->getDataField()->setProperty("name",$name);
111
+	public function setName($name) {
112
+		$this->getDataField()->setProperty("name", $name);
113 113
 		return $this;
114 114
 	}
115 115
 
116
-	public function setFluid(){
117
-		$this->getField()->addToProperty("class","fluid");
116
+	public function setFluid() {
117
+		$this->getField()->addToProperty("class", "fluid");
118 118
 		return $this;
119 119
 	}
120 120
 
121 121
 	public function setDisabled($disable=true) {
122 122
 		$field=$this->getField();
123
-		if($disable)
123
+		if ($disable)
124 124
 			$field->addToProperty("class", "disabled");
125 125
 		return $this;
126 126
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormDropdown.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,29 +7,29 @@  discard block
 block discarded – undo
7 7
 
8 8
 class HtmlFormDropdown extends HtmlFormField {
9 9
 
10
-	public function __construct($identifier,$items=array(), $label=NULL,$value="",$multiple=false,$associative=true) {
11
-		parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier,$value,$items,$associative))->asSelect($identifier,$multiple), $label);
10
+	public function __construct($identifier, $items=array(), $label=NULL, $value="", $multiple=false, $associative=true) {
11
+		parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier, $value, $items, $associative))->asSelect($identifier, $multiple), $label);
12 12
 		$this->_identifier=$identifier;
13 13
 	}
14 14
 
15
-	public function setItems($items){
15
+	public function setItems($items) {
16 16
 		return $this->getField()->setItems($items);
17 17
 	}
18
-	public function addItem($item,$value=NULL,$image=NULL){
19
-		return $this->getField()->addItem($item,$value,$image);
18
+	public function addItem($item, $value=NULL, $image=NULL) {
19
+		return $this->getField()->addItem($item, $value, $image);
20 20
 	}
21
-	public static function multipleDropdown($identifier,$items=array(), $label=NULL,$value="",$associative=true){
22
-		return new HtmlFormDropdown($identifier,$items,$label,$value,true,$associative);
21
+	public static function multipleDropdown($identifier, $items=array(), $label=NULL, $value="", $associative=true) {
22
+		return new HtmlFormDropdown($identifier, $items, $label, $value, true, $associative);
23 23
 	}
24 24
 
25 25
 	/**
26 26
 	 * @return HtmlDropdown
27 27
 	 */
28
-	public function getDataField(){
28
+	public function getDataField() {
29 29
 		return $this->getField()->getInput();
30 30
 	}
31
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
32
-		$this->getField()->asSelect($name,$multiple,$selection);
31
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
32
+		$this->getField()->asSelect($name, $multiple, $selection);
33 33
 		return $this;
34 34
 	}
35 35
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 * @param boolean $floating
38 38
 	 * @return HtmlDropdown
39 39
 	 */
40
-	public function asButton($floating=false){
40
+	public function asButton($floating=false) {
41 41
 		$field=$this->content["field"];
42 42
 		$label=$this->content["label"];
43 43
 		$field->addContent($label);
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @version 1.001
16 16
  */
17 17
 class HtmlMessage extends HtmlSemDoubleElement {
18
-	use AttachedTrait,HasTimeoutTrait;
18
+	use AttachedTrait, HasTimeoutTrait;
19 19
 	protected $icon;
20 20
 	protected $close;
21 21
 
@@ -32,39 +32,39 @@  discard block
 block discarded – undo
32 32
 	 * @param string|HtmlSemDoubleElement $header
33 33
 	 * @return \Ajax\semantic\html\collections\HtmlMessage
34 34
 	 */
35
-	public function addHeader($header){
35
+	public function addHeader($header) {
36 36
 		$headerO=$header;
37
-		if(\is_string($header)){
38
-			$headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div");
37
+		if (\is_string($header)) {
38
+			$headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div");
39 39
 			$headerO->setClass("header");
40 40
 			$headerO->setContent($header);
41 41
 		}
42
-		return $this->addContent($headerO,true);
42
+		return $this->addContent($headerO, true);
43 43
 	}
44 44
 
45
-	public function setHeader($header){
45
+	public function setHeader($header) {
46 46
 		return $this->addHeader($header);
47 47
 	}
48 48
 
49
-	public function setIcon($icon){
49
+	public function setIcon($icon) {
50 50
 		$this->addToProperty("class", "icon");
51
-		$this->wrapContent("<div class='content'>","</div>");
52
-		if(\is_string($icon)){
51
+		$this->wrapContent("<div class='content'>", "</div>");
52
+		if (\is_string($icon)) {
53 53
 			$this->icon=new HtmlIcon("icon-".$this->identifier, $icon);
54
-		}else{
54
+		} else {
55 55
 			$this->icon=$icon;
56 56
 		}
57 57
 		return $this;
58 58
 	}
59 59
 
60
-	public function addLoader($loaderIcon="notched circle"){
60
+	public function addLoader($loaderIcon="notched circle") {
61 61
 		$this->setIcon($loaderIcon);
62 62
 		$this->icon->addToIcon("loading");
63 63
 		return $this;
64 64
 	}
65 65
 
66
-	public function setDismissable($dismiss=true){
67
-		if($dismiss===true)
66
+	public function setDismissable($dismiss=true) {
67
+		if ($dismiss===true)
68 68
 			$this->close=new HtmlIcon("close-".$this->identifier, "close");
69 69
 		else
70 70
 			$this->close=NULL;
@@ -75,43 +75,43 @@  discard block
 block discarded – undo
75 75
 	 * {@inheritDoc}
76 76
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
77 77
 	 */
78
-	public function run(JsUtils $js){
79
-		if(!isset($this->_bsComponent)){
80
-			if(isset($this->close)){
78
+	public function run(JsUtils $js) {
79
+		if (!isset($this->_bsComponent)) {
80
+			if (isset($this->close)) {
81 81
 				$js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition})");
82 82
 			}
83
-			if(isset($this->_timeout)){
84
-				$js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});",true);
83
+			if (isset($this->_timeout)) {
84
+				$js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});", true);
85 85
 			}
86 86
 		}
87 87
 		return parent::run($js);
88 88
 	}
89 89
 
90
-	public function setState($visible=true){
91
-		$visible=($visible===true)?"visible":"hidden";
92
-		return $this->addToPropertyCtrl("class", $visible, array("visible","hidden"));
90
+	public function setState($visible=true) {
91
+		$visible=($visible===true) ? "visible" : "hidden";
92
+		return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden"));
93 93
 	}
94 94
 
95
-	public function setVariation($value="floating"){
96
-		return $this->addToPropertyCtrl("class", $value, array("floating","compact"));
95
+	public function setVariation($value="floating") {
96
+		return $this->addToPropertyCtrl("class", $value, array("floating", "compact"));
97 97
 	}
98 98
 
99
-	public function setStyle($style){
99
+	public function setStyle($style) {
100 100
 		return $this->addToPropertyCtrl("class", $style, Style::getConstants());
101 101
 	}
102 102
 
103
-	public function setError(){
103
+	public function setError() {
104 104
 		return $this->setStyle("error");
105 105
 	}
106 106
 
107
-	public function setWarning(){
107
+	public function setWarning() {
108 108
 		return $this->setStyle("warning");
109 109
 	}
110 110
 
111
-	public function setMessage($message){
112
-		if(\is_array($this->content)){
111
+	public function setMessage($message) {
112
+		if (\is_array($this->content)) {
113 113
 			$this->content[\sizeof($this->content)-1]=$message;
114
-		}else
114
+		} else
115 115
 			$this->setContent($message);
116 116
 	}
117 117
 
Please login to merge, or discard this patch.
Ajax/service/AjaxTransition.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,26 +3,26 @@
 block discarded – undo
3 3
 use Ajax\semantic\html\base\constants\Transition;
4 4
 
5 5
 class AjaxTransition {
6
-	public static function none($responseElement,$jqueryDone="html"){
6
+	public static function none($responseElement, $jqueryDone="html") {
7 7
 		return $responseElement.".".$jqueryDone."( data )";
8 8
 	}
9 9
 
10
-	public static function jqFade($responseElement,$jqueryDone="html"){
10
+	public static function jqFade($responseElement, $jqueryDone="html") {
11 11
 		return $responseElement.".hide().{$jqueryDone}( data ).fadeIn()";
12 12
 	}
13 13
 
14
-	public static function jqSlide($responseElement,$jqueryDone="html"){
14
+	public static function jqSlide($responseElement, $jqueryDone="html") {
15 15
 		return $responseElement.".hide().{$jqueryDone}( data ).slideDown()";
16 16
 	}
17 17
 
18
-	public static function random($responseElement,$jqueryDone="html"){
18
+	public static function random($responseElement, $jqueryDone="html") {
19 19
 		$transitions=Transition::getConstantValues();
20
-		$transition=$transitions[\rand(0,\sizeof($transitions)-1)];
21
-		return self::__callStatic($transition, [$responseElement,$jqueryDone]);
20
+		$transition=$transitions[\rand(0, \sizeof($transitions)-1)];
21
+		return self::__callStatic($transition, [$responseElement, $jqueryDone]);
22 22
 	}
23 23
 
24
-	public static function __callStatic($name, $arguments){
25
-		if(\sizeof($arguments)==2){
24
+	public static function __callStatic($name, $arguments) {
25
+		if (\sizeof($arguments)==2) {
26 26
 			$responseElement=$arguments[0];
27 27
 			$jqueryDone=$arguments[1];
28 28
 			$name=JString::camelCaseToSeparated($name);
Please login to merge, or discard this patch.
Ajax/semantic/components/Dropdown.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	 * @param string $action one of "select","auto","activate","combo","nothing","hide"
18 18
 	 * @return \Ajax\semantic\components\Dropdown
19 19
 	 */
20
-	public function setAction($action){
21
-		return $this->setParamCtrl("action", $action,array("select","auto","activate","combo","nothing","hide"));
20
+	public function setAction($action) {
21
+		return $this->setParamCtrl("action", $action, array("select", "auto", "activate", "combo", "nothing", "hide"));
22 22
 	}
23 23
 
24 24
 	/**
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 	 * @param string $event Event used to trigger dropdown (Hover, Click, Custom Event)
27 27
 	 * @return \Ajax\semantic\components\Dropdown
28 28
 	 */
29
-	public function setOn($event){
29
+	public function setOn($event) {
30 30
 		return $this->setParam("on", $event);
31 31
 	}
32 32
 
33
-	public function setFullTextSearch($value){
33
+	public function setFullTextSearch($value) {
34 34
 		return $this->setParam("fullTextSearch", $value);
35 35
 	}
36 36
 
37
-	public function setShowOnFocus($value){
37
+	public function setShowOnFocus($value) {
38 38
 		return $this->setParam("showOnFocus", $value);
39 39
 	}
40 40
 }
Please login to merge, or discard this patch.
Ajax/common/traits/JsUtilsEventsTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 trait JsUtilsEventsTrait {
12 12
 
13 13
 
14
-	protected $jquery_events=array (
15
-			"bind","blur","change","click","dblclick","delegate","die","error","focus","focusin","focusout","hover","keydown","keypress","keyup","live","load","mousedown","mousseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","off","on","one","ready","resize","scroll","select","submit","toggle","trigger","triggerHandler","undind","undelegate","unload"
14
+	protected $jquery_events=array(
15
+			"bind", "blur", "change", "click", "dblclick", "delegate", "die", "error", "focus", "focusin", "focusout", "hover", "keydown", "keypress", "keyup", "live", "load", "mousedown", "mousseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "off", "on", "one", "ready", "resize", "scroll", "select", "submit", "toggle", "trigger", "triggerHandler", "undind", "undelegate", "unload"
16 16
 	);
17 17
 
18
-	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true);
18
+	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
19 19
 
20 20
 	/**
21 21
 	 * Outputs a javascript library blur event
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 	 * @param boolean $stopPropagation
38 38
 	 * @return string
39 39
 	 */
40
-	public function change($element='this', $js='',$preventDefault=false,$stopPropagation=false) {
41
-		return $this->_add_event($element, $js, 'change',$preventDefault,$stopPropagation);
40
+	public function change($element='this', $js='', $preventDefault=false, $stopPropagation=false) {
41
+		return $this->_add_event($element, $js, 'change', $preventDefault, $stopPropagation);
42 42
 	}
43 43
 
44 44
 	/**
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 	 * @param boolean $stopPropagation
52 52
 	 * @return string
53 53
 	 */
54
-	public function click($element='this', $js='', $ret_false=TRUE,$preventDefault=false,$stopPropagation=false) {
54
+	public function click($element='this', $js='', $ret_false=TRUE, $preventDefault=false, $stopPropagation=false) {
55 55
 		if (!is_array($js)) {
56
-			$js=array (
56
+			$js=array(
57 57
 					$js
58 58
 			);
59 59
 		}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			$js[]="return false;";
63 63
 		}
64 64
 
65
-		return $this->_add_event($element, $js, 'click',$preventDefault,$stopPropagation);
65
+		return $this->_add_event($element, $js, 'click', $preventDefault, $stopPropagation);
66 66
 	}
67 67
 
68 68
 	/**
Please login to merge, or discard this patch.
Ajax/service/JArray.php 1 patch
Spacing   +30 added lines, -30 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
 	}
10 10
 
11 11
 	public static function getValue($array, $key, $pos) {
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 			return $array[$key];
14 14
 		}
15 15
 		$values=array_values($array);
16
-		if ($pos < sizeof($values))
16
+		if ($pos<sizeof($values))
17 17
 			return $values[$pos];
18 18
 	}
19 19
 
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 		$result=NULL;
22 22
 		if (array_key_exists($key, $array)) {
23 23
 			$result=$array[$key];
24
-			if ($condition($result) === true)
24
+			if ($condition($result)===true)
25 25
 				return $result;
26 26
 		}
27 27
 		$values=array_values($array);
28
-		foreach ( $values as $val ) {
29
-			if ($condition($val) === true)
28
+		foreach ($values as $val) {
29
+			if ($condition($val)===true)
30 30
 				return $val;
31 31
 		}
32 32
 		return $result;
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 		$result="";
44 44
 		if (\is_array($glue)) {
45 45
 			$size=\sizeof($pieces);
46
-			if ($size > 0) {
47
-				for($i=0; $i < $size - 1; $i++) {
48
-					$result.=$pieces[$i] . @$glue[$i];
46
+			if ($size>0) {
47
+				for ($i=0; $i<$size-1; $i++) {
48
+					$result.=$pieces[$i].@$glue[$i];
49 49
 				}
50
-				$result.=$pieces[$size - 1];
50
+				$result.=$pieces[$size-1];
51 51
 			}
52 52
 		} else {
53 53
 			$result=\implode($glue, $pieces);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public static function dimension($array) {
59 59
 		if (\is_array(reset($array))) {
60
-			$return=self::dimension(reset($array)) + 1;
60
+			$return=self::dimension(reset($array))+1;
61 61
 		} else {
62 62
 			$return=1;
63 63
 		}
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	}
66 66
 
67 67
 	public static function sortAssociative($array, $sortedKeys=array()) {
68
-		$newArray=array ();
69
-		foreach ( $sortedKeys as $key ) {
68
+		$newArray=array();
69
+		foreach ($sortedKeys as $key) {
70 70
 			if (\array_key_exists($key, $array)) {
71 71
 				$newArray[$key]=$array[$key];
72 72
 			}
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 
77 77
 	public static function moveElementTo(&$array, $from, $to) {
78 78
 		$result=false;
79
-		if(isset($array)){
80
-			if(isset($array[$from])){
81
-				$out = array_splice($array, $from, 1);
79
+		if (isset($array)) {
80
+			if (isset($array[$from])) {
81
+				$out=array_splice($array, $from, 1);
82 82
 				array_splice($array, $to, 0, $out);
83 83
 				$result=true;
84 84
 			}
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 		return $result;
87 87
 	}
88 88
 
89
-	public static function swapElements(&$array,$index1,$index2){
89
+	public static function swapElements(&$array, $index1, $index2) {
90 90
 		$result=false;
91
-		if(isset($array)){
92
-			if(isset($array[$index1])&& isset($array[$index2])){
91
+		if (isset($array)) {
92
+			if (isset($array[$index1]) && isset($array[$index2])) {
93 93
 				$tmp=$array[$index1];
94 94
 				$array[$index1]=$array[$index2];
95 95
 				$array[$index2]=$tmp;
@@ -100,33 +100,33 @@  discard block
 block discarded – undo
100 100
 	}
101 101
 
102 102
 
103
-	public static function modelArray($objects,$identifierFunction=NULL,$modelFunction=NULL){
103
+	public static function modelArray($objects, $identifierFunction=NULL, $modelFunction=NULL) {
104 104
 		$result=[];
105
-		if(isset($modelFunction)===false){
105
+		if (isset($modelFunction)===false) {
106 106
 			$modelFunction="__toString";
107 107
 		}
108
-		if(isset($identifierFunction)===false){
109
-			foreach ($objects as $object){
108
+		if (isset($identifierFunction)===false) {
109
+			foreach ($objects as $object) {
110 110
 				$result[]=self::callFunction($object, $modelFunction);
111 111
 			}
112
-		}else{
113
-			foreach ($objects as $object){
112
+		} else {
113
+			foreach ($objects as $object) {
114 114
 				$result[self::callFunction($object, $identifierFunction)]=self::callFunction($object, $modelFunction);
115 115
 			}
116 116
 		}
117 117
 		return $result;
118 118
 	}
119 119
 
120
-	private static function callFunction($object,$callback){
121
-		if(\is_string($callback))
122
-			return \call_user_func(array($object, $callback),[]);
123
-		else if (\is_callable($callback)){
120
+	private static function callFunction($object, $callback) {
121
+		if (\is_string($callback))
122
+			return \call_user_func(array($object, $callback), []);
123
+		else if (\is_callable($callback)) {
124 124
 			return $callback($object);
125 125
 		}
126 126
 	}
127 127
 
128
-	public static function count($array){
129
-		if(\is_array($array)){
128
+	public static function count($array) {
129
+		if (\is_array($array)) {
130 130
 			return \sizeof($array);
131 131
 		}
132 132
 		return 0;
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * @version 1.001
19 19
  */
20 20
 class HtmlLabel extends HtmlSemDoubleElement {
21
-	use LabeledIconTrait,HasTimeoutTrait;
21
+	use LabeledIconTrait, HasTimeoutTrait;
22 22
 
23 23
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
24 24
 		parent::__construct($identifier, $tagName, "ui label");
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	 * @return HtmlLabel
34 34
 	 */
35 35
 	public function setPointing($value=Direction::NONE) {
36
-		if($value==="left" || $value==="right")
36
+		if ($value==="left" || $value==="right")
37 37
 			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
38 38
 		else
39
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
39
+			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing", true));
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 	 * @return HtmlLabel
46 46
 	 */
47 47
 	public function toCorner($side="left") {
48
-		return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" ));
48
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
49 49
 	}
50 50
 
51
-	public function setHorizontal(){
52
-		return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal"));
51
+	public function setHorizontal() {
52
+		return $this->addToPropertyCtrl("class", "hozizontal", array("horizontal"));
53 53
 	}
54 54
 
55
-	public function setFloating(){
56
-		return $this->addToPropertyCtrl("class", "floating",array("floating"));
55
+	public function setFloating() {
56
+		return $this->addToPropertyCtrl("class", "floating", array("floating"));
57 57
 	}
58 58
 
59 59
 	/**
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 		return $this->addToProperty("class", "tag");
65 65
 	}
66 66
 
67
-	public function setEmpty(){
67
+	public function setEmpty() {
68 68
 		$this->content=NULL;
69
-		return $this->addToPropertyCtrl("class", "empty",array("empty"));
69
+		return $this->addToPropertyCtrl("class", "empty", array("empty"));
70 70
 	}
71 71
 
72 72
 	public function setBasic() {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function addEmphasisImage($src, $alt="", $before=true) {
84 84
 		$this->addToProperty("class", "image");
85
-		return $this->addImage($src,$alt,$before);
85
+		return $this->addImage($src, $alt, $before);
86 86
 	}
87 87
 
88 88
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @return HtmlImg
94 94
 	 */
95 95
 	public function addAvatarImage($src, $alt="", $before=true) {
96
-		$img=$this->addImage($src,$alt,$before);
96
+		$img=$this->addImage($src, $alt, $before);
97 97
 		$img->setClass("ui image");
98 98
 		$img->asAvatar();
99 99
 		return $img;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	* @return HtmlImg
108 108
 	*/
109 109
 	public function addImage($src, $alt="", $before=true) {
110
-		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
110
+		$img=new HtmlImg("image-".$this->identifier, $src, $alt);
111 111
 		$img->setClass("");
112 112
 		$this->addContent($img, $before);
113 113
 		return $img;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * @return HtmlDoubleElement
120 120
 	 */
121 121
 	public function addDetail($detail) {
122
-		$div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail");
122
+		$div=new HtmlSemDoubleElement("detail-".$this->identifier, $this->tagName, "detail");
123 123
 		$div->setContent($detail);
124 124
 		$this->addContent($div);
125 125
 		return $div;
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 	 * @return HtmlLabel
131 131
 	 */
132 132
 	public function asRibbon($direction=Direction::NONE) {
133
-		return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" ));
133
+		return $this->addToPropertyCtrl("class", $direction." ribbon", array("ribbon", "right ribbon", "left ribbon"));
134 134
 	}
135 135
 
136
-	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
137
-		if($direction!==Direction::NONE)
138
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
136
+	public function setAttached($side=Side::TOP, $direction=Direction::NONE) {
137
+		if ($direction!==Direction::NONE)
138
+			return $this->addToPropertyCtrl("class", $side." ".$direction." attached", Side::getConstantValues($direction." attached"));
139 139
 		else
140
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
140
+			return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
141 141
 	}
142 142
 
143 143
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @param string $direction one of RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE="",BELOW="below"
147 147
 	 * @return HtmlLabel
148 148
 	 */
149
-	public static function ribbon($identifier, $caption,$direction=Direction::NONE) {
149
+	public static function ribbon($identifier, $caption, $direction=Direction::NONE) {
150 150
 		return (new HtmlLabel($identifier, $caption))->asRibbon($direction);
151 151
 	}
152 152
 
Please login to merge, or discard this patch.