@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | return $this->content; |
28 | 28 | } |
29 | 29 | |
30 | - public function addContent($content,$before=false) { |
|
30 | + public function addContent($content, $before=false) { |
|
31 | 31 | if (!\is_array($this->content)) { |
32 | - if(isset($this->content)) |
|
33 | - $this->content=array ($this->content); |
|
32 | + if (isset($this->content)) |
|
33 | + $this->content=array($this->content); |
|
34 | 34 | else |
35 | 35 | $this->content=array(); |
36 | 36 | } |
37 | - if($before) |
|
38 | - array_unshift($this->content,$content); |
|
37 | + if ($before) |
|
38 | + array_unshift($this->content, $content); |
|
39 | 39 | else |
40 | 40 | $this->content []=$content; |
41 | 41 | return $this; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if ($this->content instanceof HtmlDoubleElement) { |
51 | 51 | $this->content->run($js); |
52 | 52 | } else if (\is_array($this->content)) { |
53 | - foreach ( $this->content as $itemContent ) { |
|
53 | + foreach ($this->content as $itemContent) { |
|
54 | 54 | if ($itemContent instanceof HtmlDoubleElement) { |
55 | 55 | $itemContent->run($js); |
56 | 56 | } |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | return $this; |
68 | 68 | } |
69 | 69 | |
70 | - public function getContentInstances($class){ |
|
71 | - return $this->_getContentInstances($class,$this->content); |
|
70 | + public function getContentInstances($class) { |
|
71 | + return $this->_getContentInstances($class, $this->content); |
|
72 | 72 | } |
73 | 73 | |
74 | - protected function _getContentInstances($class,$content){ |
|
74 | + protected function _getContentInstances($class, $content) { |
|
75 | 75 | $instances=[]; |
76 | - if($content instanceof $class){ |
|
76 | + if ($content instanceof $class) { |
|
77 | 77 | $instances[]=$content; |
78 | - }elseif($content instanceof HtmlDoubleElement){ |
|
79 | - $instances=\array_merge($instances,$content->getContentInstances($class)); |
|
80 | - }elseif (\is_array($content)){ |
|
81 | - foreach ($content as $element){ |
|
82 | - $instances=\array_merge($instances,$this->_getContentInstances($class, $element)); |
|
78 | + }elseif ($content instanceof HtmlDoubleElement) { |
|
79 | + $instances=\array_merge($instances, $content->getContentInstances($class)); |
|
80 | + }elseif (\is_array($content)) { |
|
81 | + foreach ($content as $element) { |
|
82 | + $instances=\array_merge($instances, $this->_getContentInstances($class, $element)); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | return $instances; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | class HtmlInput extends HtmlSingleElement { |
10 | 10 | protected $_placeholder; |
11 | - public function __construct($identifier,$type="text",$value=NULL,$placeholder=NULL) { |
|
11 | + public function __construct($identifier, $type="text", $value=NULL, $placeholder=NULL) { |
|
12 | 12 | parent::__construct($identifier, "input"); |
13 | 13 | $this->setProperty("name", $identifier); |
14 | 14 | $this->setValue($value); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | public function setValue($value) { |
20 | - if(isset($value)) |
|
20 | + if (isset($value)) |
|
21 | 21 | $this->setProperty("value", $value); |
22 | 22 | return $this; |
23 | 23 | } |
@@ -26,19 +26,19 @@ discard block |
||
26 | 26 | return $this->setProperty("type", $value); |
27 | 27 | } |
28 | 28 | |
29 | - public function setPlaceholder($value){ |
|
30 | - if(JString::isNotNull($value)) |
|
29 | + public function setPlaceholder($value) { |
|
30 | + if (JString::isNotNull($value)) |
|
31 | 31 | $this->_placeholder=$value; |
32 | 32 | return $this; |
33 | 33 | } |
34 | 34 | |
35 | - public function compile(JsUtils $js=NULL,&$view=NULL){ |
|
35 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
36 | 36 | $value=$this->_placeholder; |
37 | - if(JString::isNull($value)){ |
|
38 | - if(JString::isNotNull($this->getProperty("name"))) |
|
37 | + if (JString::isNull($value)) { |
|
38 | + if (JString::isNotNull($this->getProperty("name"))) |
|
39 | 39 | $value=\ucfirst($this->getProperty("name")); |
40 | 40 | } |
41 | 41 | $this->setProperty("placeholder", $value); |
42 | - return parent::compile($js,$view); |
|
42 | + return parent::compile($js, $view); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | \ No newline at end of file |
@@ -16,6 +16,6 @@ |
||
16 | 16 | if (isset($toElement)) { |
17 | 17 | $toElement->setAttached(true); |
18 | 18 | } |
19 | - return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached")); |
|
19 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Ajax\semantic\html\collections\table\traits; |
3 | 3 | |
4 | -trait TableTrait{ |
|
4 | +trait TableTrait { |
|
5 | 5 | /** |
6 | 6 | * @return HtmlTable |
7 | 7 | */ |
8 | 8 | abstract protected function getTable(); |
9 | 9 | |
10 | - protected function addToPropertyTable($property,$value){ |
|
10 | + protected function addToPropertyTable($property, $value) { |
|
11 | 11 | return $this->getTable()->addToProperty($property, $value); |
12 | 12 | } |
13 | 13 | |
@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | public function setBasic($very=false) { |
19 | 19 | $table=$this->getTable(); |
20 | 20 | if ($very) |
21 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
22 | - return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
|
21 | + $table->addToPropertyCtrl("class", "very", array("very")); |
|
22 | + return $table->addToPropertyCtrl("class", "basic", array("basic")); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function setCompact($very=false) { |
26 | 26 | $table=$this->getTable(); |
27 | 27 | if ($very) |
28 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
29 | - return $table->addToPropertyCtrl("class", "compact", array ("compact" )); |
|
28 | + $table->addToPropertyCtrl("class", "very", array("very")); |
|
29 | + return $table->addToPropertyCtrl("class", "compact", array("compact")); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function setCollapsing() { |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | * @property SimpleExtComponent $_bsComponent |
12 | 12 | * @property string identifier |
13 | 13 | */ |
14 | -trait BaseHtmlEventsTrait{ |
|
14 | +trait BaseHtmlEventsTrait { |
|
15 | 15 | |
16 | - protected $_events=array (); |
|
16 | + protected $_events=array(); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param string $event |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | * @return \Ajax\common\html\BaseHtml |
24 | 24 | */ |
25 | 25 | public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
26 | - if ($stopPropagation === true) { |
|
27 | - $jsCode=Javascript::$stopPropagation . $jsCode; |
|
26 | + if ($stopPropagation===true) { |
|
27 | + $jsCode=Javascript::$stopPropagation.$jsCode; |
|
28 | 28 | } |
29 | - if ($preventDefault === true) { |
|
30 | - $jsCode=Javascript::$preventDefault . $jsCode; |
|
29 | + if ($preventDefault===true) { |
|
30 | + $jsCode=Javascript::$preventDefault.$jsCode; |
|
31 | 31 | } |
32 | 32 | return $this->_addEvent($event, $jsCode); |
33 | 33 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (\is_array($this->_events[$event])) { |
43 | 43 | $this->_events[$event][]=$jsCode; |
44 | 44 | } else { |
45 | - $this->_events[$event]=array ($this->_events[$event],$jsCode ); |
|
45 | + $this->_events[$event]=array($this->_events[$event], $jsCode); |
|
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | $this->_events[$event]=$jsCode; |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | return $this->onClick($jsCode); |
70 | 70 | } |
71 | 71 | |
72 | - public function onCreate($jsCode){ |
|
73 | - if(isset($this->_events["_create"])){ |
|
72 | + public function onCreate($jsCode) { |
|
73 | + if (isset($this->_events["_create"])) { |
|
74 | 74 | $this->_events["_create"][]=$jsCode; |
75 | - }else{ |
|
75 | + } else { |
|
76 | 76 | $this->_events["_create"]=[$jsCode]; |
77 | 77 | } |
78 | 78 | return $this; |
@@ -81,15 +81,15 @@ discard block |
||
81 | 81 | public function addEventsOnRun(JsUtils $js=NULL) { |
82 | 82 | $this->_eventsOnCreate($js); |
83 | 83 | if (isset($this->_bsComponent)) { |
84 | - foreach ( $this->_events as $event => $jsCode ) { |
|
84 | + foreach ($this->_events as $event => $jsCode) { |
|
85 | 85 | $code=$jsCode; |
86 | 86 | if (\is_array($jsCode)) { |
87 | 87 | $code=""; |
88 | - foreach ( $jsCode as $jsC ) { |
|
88 | + foreach ($jsCode as $jsC) { |
|
89 | 89 | if ($jsC instanceof AjaxCall) { |
90 | - $code.="\n" . $jsC->compile($js); |
|
90 | + $code.="\n".$jsC->compile($js); |
|
91 | 91 | } else { |
92 | - $code.="\n" . $jsC; |
|
92 | + $code.="\n".$jsC; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } elseif ($jsCode instanceof AjaxCall) { |
@@ -97,18 +97,18 @@ discard block |
||
97 | 97 | } |
98 | 98 | $this->_bsComponent->addEvent($event, $code); |
99 | 99 | } |
100 | - $this->_events=array (); |
|
100 | + $this->_events=array(); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - protected function _eventsOnCreate(JsUtils $js=NULL){ |
|
105 | - if(isset($this->_events["_create"])){ |
|
104 | + protected function _eventsOnCreate(JsUtils $js=NULL) { |
|
105 | + if (isset($this->_events["_create"])) { |
|
106 | 106 | $create=$this->_events["_create"]; |
107 | - if(\is_array($create)){ |
|
107 | + if (\is_array($create)) { |
|
108 | 108 | $create=\implode("", $create); |
109 | 109 | } |
110 | - if(isset($js) && $create!=="") |
|
111 | - $js->exec($create,true); |
|
110 | + if (isset($js) && $create!=="") |
|
111 | + $js->exec($create, true); |
|
112 | 112 | unset($this->_events["_create"]); |
113 | 113 | } |
114 | 114 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @return BaseHtml |
123 | 123 | */ |
124 | 124 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
125 | - $params=array ("url" => $url,"responseElement" => $responseElement ); |
|
125 | + $params=array("url" => $url, "responseElement" => $responseElement); |
|
126 | 126 | $params=array_merge($params, $parameters); |
127 | 127 | $this->_addEvent($event, new AjaxCall($operation, $params)); |
128 | 128 | return $this; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | public function jsDoJquery($jqueryCall, $param="") { |
158 | - return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . Javascript::prep_value($param) . ");"; |
|
158 | + return "$('#".$this->identifier."').".$jqueryCall."(".Javascript::prep_value($param).");"; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | public function executeOnRun($jsCode) { |
@@ -6,8 +6,8 @@ |
||
6 | 6 | public static $preventDefault="\nif(event && event.preventDefault) event.preventDefault();\n"; |
7 | 7 | public static $stopPropagation="\nif(event && event.stopPropagation) event.stopPropagation();\n"; |
8 | 8 | |
9 | - public static function containsCode($expression){ |
|
10 | - return strrpos($expression, 'this')!==false||strrpos($expression, 'event')!==false||strrpos($expression, 'self')!==false; |
|
9 | + public static function containsCode($expression) { |
|
10 | + return strrpos($expression, 'this')!==false || strrpos($expression, 'event')!==false || strrpos($expression, 'self')!==false; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | * @return \Ajax\semantic\html\collections\HtmlMenu |
41 | 41 | */ |
42 | 42 | public function setType($type="") { |
43 | - return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
|
43 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function setActiveItem($index) { |
47 | 47 | $item=$this->getItem($index); |
48 | - if ($item !== null) { |
|
48 | + if ($item!==null) { |
|
49 | 49 | $item->addToProperty("class", "active"); |
50 | 50 | } |
51 | 51 | return $this; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | private function getItemToInsert($item) { |
55 | 55 | if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButtonGroups || $item instanceof HtmlButton || $item instanceof HtmlLabel) { |
56 | - $itemO=new HtmlMenuItem("item-" . $this->identifier . "-" . \sizeof($this->content) , $item); |
|
56 | + $itemO=new HtmlMenuItem("item-".$this->identifier."-".\sizeof($this->content), $item); |
|
57 | 57 | $item=$itemO; |
58 | 58 | } |
59 | 59 | return $item; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | private function afterInsert($item) { |
63 | 63 | if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
64 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
64 | + $item->addToPropertyCtrl("class", "item", array("item")); |
|
65 | 65 | else { |
66 | 66 | $this->setSecondary(); |
67 | 67 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function addItem($item) { |
78 | 78 | $number=$item; |
79 | 79 | $item=parent::addItem($this->getItemToInsert($item)); |
80 | - if(\is_int($number)) |
|
80 | + if (\is_int($number)) |
|
81 | 81 | $item->setProperty("data-page", $number); |
82 | 82 | return $this->afterInsert($item); |
83 | 83 | } |
@@ -95,15 +95,15 @@ discard block |
||
95 | 95 | |
96 | 96 | public function generateMenuAsItem($menu, $header=null) { |
97 | 97 | $count=$this->count(); |
98 | - $item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div"); |
|
98 | + $item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div"); |
|
99 | 99 | if (isset($header)) { |
100 | - $headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header"); |
|
100 | + $headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header"); |
|
101 | 101 | $headerItem->setContent($header); |
102 | 102 | $item->addContent($headerItem); |
103 | 103 | $this->_itemHeader=$headerItem; |
104 | 104 | } |
105 | - if(\is_array($menu)){ |
|
106 | - $menu=new HtmlMenu("menu-" . $this->identifier . "-" . $count,$menu); |
|
105 | + if (\is_array($menu)) { |
|
106 | + $menu=new HtmlMenu("menu-".$this->identifier."-".$count, $menu); |
|
107 | 107 | } |
108 | 108 | $menu->setClass("menu"); |
109 | 109 | $item->addContent($menu); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value); |
119 | 119 | $value->addContent(new HtmlIcon("", "dropdown")); |
120 | 120 | $value=$this->addItem($value); |
121 | - $popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content); |
|
121 | + $popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content); |
|
122 | 122 | $popup->setFlowing()->setPosition("bottom left")->setOn("click"); |
123 | 123 | $this->wrap("", $popup); |
124 | 124 | return $popup; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | public function addDropdownAsItem($value, $items=NULL) { |
128 | 128 | $dd=$value; |
129 | 129 | if (\is_string($value)) { |
130 | - $dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items); |
|
130 | + $dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items); |
|
131 | 131 | } |
132 | 132 | $this->addItem($dd); |
133 | 133 | return $dd; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
141 | 141 | */ |
142 | 142 | protected function createItem($value) { |
143 | - $itemO=new HtmlMenuItem($this->identifier."-item-" . \sizeof($this->content),""); |
|
143 | + $itemO=new HtmlMenuItem($this->identifier."-item-".\sizeof($this->content), ""); |
|
144 | 144 | $itemO->setTagName("a"); |
145 | 145 | $itemO->setContent($value); |
146 | 146 | return $itemO; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | public function setSecondary($value=true) { |
154 | - if($value) |
|
154 | + if ($value) |
|
155 | 155 | $this->addToProperty("class", "secondary"); |
156 | 156 | else |
157 | 157 | $this->removePropertyValue("class", "secondary"); |
@@ -159,28 +159,28 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | public function setVertical() { |
162 | - return $this->addToPropertyCtrl("class", "vertical", array ("vertical" )); |
|
162 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | public function setPosition($value="right") { |
166 | - return $this->addToPropertyCtrl("class", $value, array ("right","left" )); |
|
166 | + return $this->addToPropertyCtrl("class", $value, array("right", "left")); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | public function setPointing($value=Direction::NONE) { |
170 | - return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing")); |
|
170 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | public function asTab($vertical=false) { |
174 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
174 | + $this->apply(function(HtmlDoubleElement&$item) { |
|
175 | 175 | $item->setTagName("a"); |
176 | 176 | }); |
177 | - if ($vertical === true) |
|
177 | + if ($vertical===true) |
|
178 | 178 | $this->setVertical(); |
179 | 179 | return $this->addToProperty("class", "tabular"); |
180 | 180 | } |
181 | 181 | |
182 | 182 | public function asPagination() { |
183 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
183 | + $this->apply(function(HtmlDoubleElement&$item) { |
|
184 | 184 | $item->setTagName("a"); |
185 | 185 | }); |
186 | 186 | return $this->addToProperty("class", "pagination"); |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function setWidth($width) { |
219 | 219 | if (\is_int($width)) { |
220 | - $width=Wide::getConstants()["W" . $width]; |
|
220 | + $width=Wide::getConstants()["W".$width]; |
|
221 | 221 | } |
222 | 222 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
223 | - return $this->addToPropertyCtrl("class", "item", array ("item" )); |
|
223 | + return $this->addToPropertyCtrl("class", "item", array("item")); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | public function addImage($identifier, $src="", $alt="") { |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | return $this->_itemHeader; |
236 | 236 | } |
237 | 237 | |
238 | - public function run(JsUtils $js){ |
|
239 | - $result= parent::run($js); |
|
238 | + public function run(JsUtils $js) { |
|
239 | + $result=parent::run($js); |
|
240 | 240 | return $result->setItemSelector(".item"); |
241 | 241 | } |
242 | 242 | } |
243 | 243 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | public function setClass($classNames) { |
16 | - if(\is_array($classNames)){ |
|
16 | + if (\is_array($classNames)) { |
|
17 | 17 | $classNames=implode(" ", $classNames); |
18 | 18 | } |
19 | 19 | $this->setProperty("class", $classNames); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | public function addClass($classNames) { |
24 | - if(\is_array($classNames)){ |
|
24 | + if (\is_array($classNames)) { |
|
25 | 25 | $classNames=implode(" ", $classNames); |
26 | 26 | } |
27 | 27 | $this->addToProperty("class", $classNames); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function fromArray($array) { |
54 | 54 | $array=parent::fromArray($array); |
55 | - foreach ( $array as $key => $value ) { |
|
55 | + foreach ($array as $key => $value) { |
|
56 | 56 | $this->setProperty($key, $value); |
57 | 57 | } |
58 | 58 | return $array; |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | * @author jc |
9 | 9 | * |
10 | 10 | */ |
11 | -trait BaseHtmlPropertiesTrait{ |
|
11 | +trait BaseHtmlPropertiesTrait { |
|
12 | 12 | |
13 | - protected $properties=array (); |
|
13 | + protected $properties=array(); |
|
14 | 14 | abstract protected function ctrl($name, $value, $typeCtrl); |
15 | 15 | abstract protected function removeOldValues(&$oldValue, $allValues); |
16 | - abstract protected function _getElementBy($callback,$elements); |
|
16 | + abstract protected function _getElementBy($callback, $elements); |
|
17 | 17 | public function getProperties() { |
18 | 18 | return $this->properties; |
19 | 19 | } |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | |
40 | 40 | public function addToProperty($name, $value, $separator=" ") { |
41 | 41 | if (\is_array($value)) { |
42 | - foreach ( $value as $v ) { |
|
42 | + foreach ($value as $v) { |
|
43 | 43 | $this->addToProperty($name, $v, $separator); |
44 | 44 | } |
45 | - } else if ($value !== "" && $this->propertyContains($name, $value) === false) { |
|
45 | + } else if ($value!=="" && $this->propertyContains($name, $value)===false) { |
|
46 | 46 | $v=@$this->properties[$name]; |
47 | - if (isset($v) && $v !== "") |
|
48 | - $v=$v . $separator . $value; |
|
47 | + if (isset($v) && $v!=="") |
|
48 | + $v=$v.$separator.$value; |
|
49 | 49 | else |
50 | 50 | $v=$value; |
51 | 51 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | public function addToPropertyCtrlCheck($name, $value, $typeCtrl) { |
86 | - if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
86 | + if ($this->ctrl($name, $value, $typeCtrl)===true) { |
|
87 | 87 | return $this->addToProperty($name, $value); |
88 | 88 | } |
89 | 89 | return $this; |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
107 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
107 | + if ($this->ctrl($name, $value, $typeCtrl)===true) |
|
108 | 108 | return $this->setProperty($name, $value); |
109 | 109 | return $this; |
110 | 110 | } |
111 | 111 | |
112 | - protected function getElementByPropertyValue($propertyName,$value, $elements) { |
|
113 | - return $this->_getElementBy(function($element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements); |
|
112 | + protected function getElementByPropertyValue($propertyName, $value, $elements) { |
|
113 | + return $this->_getElementBy(function($element) use ($propertyName, $value){return $element->propertyContains($propertyName, $value)===true; }, $elements); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | \ No newline at end of file |