Skip to content

Commit 299fb12

Browse files
committed
\is_array refactoring
1 parent b007d67 commit 299fb12

36 files changed

+60
-60
lines changed

Ajax/Jquery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function tablesorter($table='', $options='') {
202202
* @return string
203203
*/
204204
public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true) {
205-
if (is_array($js)) {
205+
if (\is_array($js)) {
206206
$js=implode("\n\t\t", $js);
207207
}
208208
if ($preventDefault===true) {

Ajax/JsUtils.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function config($config=NULL) {
155155
if ($this->config===NULL) {
156156
$this->config=new DefaultConfig();
157157
}
158-
} elseif (is_array($config)) {
158+
} elseif (\is_array($config)) {
159159
$this->config=new Config($config);
160160
} elseif ($config instanceof Config) {
161161
$this->config=$config;
@@ -306,7 +306,7 @@ public function generate_json($result=NULL, $match_array_type=FALSE) {
306306
if (!is_null($result)) {
307307
if (is_object($result)) {
308308
$json_result=$result->result_array();
309-
} elseif (is_array($result)) {
309+
} elseif (\is_array($result)) {
310310
$json_result=$result;
311311
} else {
312312
return $this->_prep_args($result);
@@ -378,7 +378,7 @@ public function getCDNs() {
378378
}
379379

380380
public function setCDNs($cdns) {
381-
if (is_array($cdns)===false) {
381+
if (!\is_array($cdns)) {
382382
$cdns=array (
383383
$cdns
384384
);

Ajax/bootstrap/html/HtmlBreadcrumbs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct($identifier,$elements=array(),$autoActive=true,$star
6262
*/
6363
public function addElement($element,$href="",$glyph=NULL){
6464
$size=sizeof($this->content);
65-
if(is_array($element)){
65+
if(\is_array($element)){
6666
$elm=new HtmlLink("lnk-".$this->identifier."-".$size);
6767
$elm->fromArray($element);
6868
}else if($element instanceof HtmlLink){

Ajax/bootstrap/html/HtmlButtongroups.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function addElement($element) {
7474
$this->elements[]=$element;
7575
} elseif ($element instanceof HtmlButton) {
7676
$this->elements[]=$element;
77-
} elseif (is_array($element)) {
77+
} elseif (\is_array($element)) {
7878
if (array_key_exists("glyph", $element))
7979
$bt=new HtmlGlyphButton($this->identifier."-button-".$iid);
8080
elseif (array_key_exists("btnCaption", $element)) {

Ajax/bootstrap/html/HtmlCarousel.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($identifier, $images=NULL) {
2727
parent::__construct($identifier);
2828
$this->_template=include 'templates/tplCarousel.php';
2929
if ($images!=NULL) {
30-
if (is_array($images)) {
30+
if (\is_array($images)) {
3131
$this->fromArray($images);
3232
}
3333
}
@@ -93,7 +93,7 @@ public function setLeftGlyph($glyphicon) {
9393
}
9494

9595
public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL) {
96-
if(is_array($imageSrc)){
96+
if(\is_array($imageSrc)){
9797
$this->addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]);
9898
}else{
9999
$image=new HtmlCarouselItem("item-".$this->identifier);
@@ -117,9 +117,9 @@ public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NU
117117
* @see \Ajax\bootstrap\html\base\BaseHtml::fromArray()
118118
*/
119119
public function fromArray($array) {
120-
if (is_array($array) && sizeof($array)>0) {
120+
if (\is_array($array) && sizeof($array)>0) {
121121
foreach ( $array as $value ) {
122-
if (is_array($value)) {
122+
if (\is_array($value)) {
123123
$this->addImage($value ["src"], @$value ["alt"], @$value ["caption"], @$value ["description"]);
124124
} else {
125125
$this->addImage($value);

Ajax/bootstrap/html/HtmlDropdown.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ public function addHeader($caption) {
108108

109109
public function addItems($items) {
110110
$iid=$this->getItemsCount()+1;
111-
if (is_array($items)) {
111+
if (\is_array($items)) {
112112
foreach ( $items as $item ) {
113113
if (is_string($item)) {
114114
$this->addItem($item);
115-
} else if (is_array($item)) {
115+
} else if (\is_array($item)) {
116116
$dropDownItem=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid);
117117
$dropDownItem->fromArray($item);
118118
$this->items []=$dropDownItem;

Ajax/bootstrap/html/HtmlListgroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function addItem($text="") {
3737
}
3838

3939
$item=new HtmlListgroupItem($element);
40-
if (is_array($text)===true) {
40+
if (\is_array($text)) {
4141
$item->setHeadingAndContent($text);
4242
}
4343
$this->content []=$item;

Ajax/bootstrap/html/HtmlNavbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function fromArray($array) {
106106
}
107107

108108
public function setNavZones($navZones) {
109-
if (is_array($navZones)) {
109+
if (\is_array($navZones)) {
110110
foreach ( $navZones as $zoneType => $zoneArray ) {
111111
if (is_string($zoneType)) {
112112
$zone=$this->addZone($zoneType);

Ajax/bootstrap/html/HtmlProgressbar.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct($identifier, $style="info", $value=0, $max=100, $min
2929
}
3030

3131
public function setActive($value) {
32-
if(is_array($this->content)){
32+
if(\is_array($this->content)){
3333
foreach ($this->content as $pb){
3434
$pb->setActive($value);
3535
}
@@ -43,7 +43,7 @@ public function setActive($value) {
4343
}
4444

4545
public function setStriped($value) {
46-
if(is_array($this->content)){
46+
if(\is_array($this->content)){
4747
foreach ($this->content as $pb){
4848
$pb->setStriped($value);
4949
}
@@ -57,7 +57,7 @@ public function setStriped($value) {
5757
}
5858

5959
public function showCaption($value) {
60-
if(is_array($this->content)){
60+
if(\is_array($this->content)){
6161
foreach ($this->content as $pb){
6262
$pb->showCaption($value);
6363
}
@@ -80,7 +80,7 @@ public function stack(HtmlProgressbar $progressBar) {
8080
$progressBar->showCaption($this->caption=="%value%%");
8181
$progressBar->setStriped($this->striped!=="" || $progressBar->isStriped());
8282
$progressBar->setActive($this->active==="active" || $progressBar->isActive());
83-
if (is_array($this->content)===false) {
83+
if (!is_array($this->content)) {
8484
$this->content=array ();
8585
}
8686
$this->content []=$progressBar;

Ajax/bootstrap/html/HtmlTabs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function addTab($element, $index=null) {
5656
if (is_string($element)) {
5757
$tab=new HtmlTabItem("tab-".$this->identifier."-".$iid, $element);
5858
$this->addTab_($tab, $index);
59-
} elseif (is_array($element)) {
59+
} elseif (\is_array($element)) {
6060
$tab=new HtmlTabItem("tab-".$this->identifier."-".$iid);
6161
$tab->fromArray($element);
6262
$this->addTab_($tab, $index);

0 commit comments

Comments
 (0)