Skip to content

Commit 7122807

Browse files
committed
warnings fixed
1 parent dc691e2 commit 7122807

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

Ajax/common/html/traits/BaseHtmlPropertiesTrait.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ public function addToProperty($name, $value, $separator=" ") {
4444
$this->_self->addToProperty($name, $v, $separator);
4545
}
4646
} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
47-
$v=@$this->_self->properties[$name];
48-
if (isset($v) && $v !== "")
49-
$v=$v . $separator . $value;
50-
else
51-
$v=$value;
52-
53-
return $this->_self->setProperty($name, $v);
47+
if(isset($this->_self->properties[$name])){
48+
$v=$this->_self->properties[$name];
49+
if (isset($v) && $v !== "")
50+
$v=$v . $separator . $value;
51+
else
52+
$v=$value;
53+
54+
return $this->_self->setProperty($name, $v);
55+
}
5456
}
5557
return $this;
5658
}
@@ -71,7 +73,7 @@ protected function removePropertyValues($name, $values) {
7173
}
7274

7375
protected function addToPropertyUnique($name, $value, $typeCtrl) {
74-
if (@class_exists($typeCtrl, true))
76+
if (is_string($typeCtrl) && @class_exists($typeCtrl, true))
7577
$typeCtrl=$typeCtrl::getConstants();
7678
if (\is_array($typeCtrl)) {
7779
$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);

Ajax/semantic/html/content/HtmlStepItem.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ public function __construct($identifier, $content) {
1212
}
1313
protected function initContent($content){
1414
if(\is_array($content)){
15-
if(JArray::isAssociative($content)===false){
16-
$icon=@$content[0];
17-
$title=@$content[1];
18-
$desc=@$content[2];
19-
$status=@$content[3];
20-
}else{
21-
$icon=@$content["icon"];
22-
$title=@$content["title"];
23-
$desc=@$content["description"];
24-
$status=@$content["status"];
25-
}
15+
$icon=JArray::getValue($content, "icon", 0);
16+
$title=JArray::getValue($content, "title", 1);
17+
$desc=JArray::getValue($content, "description", 2);
18+
$status=JArray::getValue($content, "status", 3);
2619
if(isset($icon)){
2720
$this->setIcon($icon);
2821
}

0 commit comments

Comments
 (0)