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);

Ajax/bootstrap/html/content/HtmlListgroupItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function compile(JsUtils $js=NULL, &$view=NULL) {
5959
}
6060

6161
public function setHeadingAndContent($title, $content="", $niveau="1") {
62-
if (is_array($title)) {
62+
if (\is_array($title)) {
6363
$array=$title;
6464
$title=JArray::getValue($array, "title", 0);
6565
$content=JArray::getValue($array, "content", 1);

Ajax/bootstrap/html/content/HtmlNavzone.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function addElement($element) {
4343
$this->addLink($element);
4444
} else if (is_object($element)) {
4545
$this->elements []=$element;
46-
} else if (is_array($element)) {
46+
} else if (\is_array($element)) {
4747
$this->addLink(array_pop($element), array_pop($element));
4848
} else {
4949
$this->addLink($element);
@@ -58,12 +58,12 @@ public function setValues($class, $tagName, $elements=array()) {
5858
}
5959

6060
public function addElements($elements) {
61-
if (is_array($elements)) {
61+
if (\is_array($elements)) {
6262
foreach ( $elements as $key => $element ) {
6363
$iid=$this->getElementsCount()+1;
6464
if ($element instanceof HtmlDropdownItem)
6565
$this->elements []=$element;
66-
else if (is_array($element)) {
66+
else if (\is_array($element)) {
6767
if (is_string($key)===true) {
6868
$dropdown=new HtmlDropdown($this->identifier."-dropdown-".$iid);
6969
$dropdown->addItems($element);

Ajax/common/BaseGui.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function addComponent(SimpleComponent $component, $attachTo, $params) {
5858
if (isset($attachTo))
5959
$component->attach($attachTo);
6060
if (isset($params))
61-
if (is_array($params))
61+
if (\is_array($params))
6262
$component->setParams($params);
6363
return $component;
6464
}

Ajax/common/components/BaseComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function compile(JsUtils $js=NULL) {
5656
}
5757

5858
protected function setParamCtrl($key, $value, $typeCtrl) {
59-
if (is_array($typeCtrl)) {
59+
if (\is_array($typeCtrl)) {
6060
if (array_search($value, $typeCtrl)===false)
6161
throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
6262
} else {

Ajax/common/components/SimpleComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function on($event, $jsCode) {
7474
}
7575

7676
protected function setParamCtrl($key, $value, $typeCtrl) {
77-
if (is_array($typeCtrl)) {
77+
if (\is_array($typeCtrl)) {
7878
if (array_search($value, $typeCtrl)===false)
7979
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)."}");
8080
} else {

Ajax/common/html/BaseHtml.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function compile(JsUtils $js=NULL, &$view=NULL) {
8080
$result=$this->getTemplate($js);
8181
foreach ( $this as $key => $value ) {
8282
if (JString::startswith($key, "_") === false && $key !== "events") {
83-
if (is_array($value)) {
83+
if (\is_array($value)) {
8484
$v=PropertyWrapper::wrap($value, $js);
8585
} else {
8686
$v=$value;
@@ -98,7 +98,7 @@ public function compile(JsUtils $js=NULL, &$view=NULL) {
9898
}
9999

100100
protected function ctrl($name, $value, $typeCtrl) {
101-
if (is_array($typeCtrl)) {
101+
if (\is_array($typeCtrl)) {
102102
if (array_search($value, $typeCtrl) === false) {
103103
throw new \Exception("La valeur passée `" . $value . "` à la propriété `" . $name . "` ne fait pas partie des valeurs possibles : {" . implode(",", $typeCtrl) . "}");
104104
}
@@ -132,7 +132,7 @@ protected function setMemberCtrl(&$name, $value, $typeCtrl) {
132132
}
133133

134134
protected function addToMemberUnique(&$name, $value, $typeCtrl, $separator=" ") {
135-
if (is_array($typeCtrl)) {
135+
if (\is_array($typeCtrl)) {
136136
$this->removeOldValues($name, $typeCtrl);
137137
$name.=$separator . $value;
138138
}
@@ -157,7 +157,7 @@ public function removeProperty($name) {
157157

158158
protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
159159
if ($this->ctrl($name, $value, $typeCtrl) === true) {
160-
if (is_array($typeCtrl)) {
160+
if (\is_array($typeCtrl)) {
161161
$this->removeOldValues($name, $typeCtrl);
162162
}
163163
$name.=$separator . $value;
@@ -173,7 +173,7 @@ protected function addToMember(&$name, $value, $separator=" ") {
173173
protected function addToPropertyUnique($name, $value, $typeCtrl) {
174174
if (@class_exists($typeCtrl, true))
175175
$typeCtrl=$typeCtrl::getConstants();
176-
if (is_array($typeCtrl)) {
176+
if (\is_array($typeCtrl)) {
177177
$this->removeOldValues($this->properties[$name], $typeCtrl);
178178
}
179179
return $this->addToProperty($name, $value);
@@ -261,7 +261,7 @@ public function wrap($before, $after="") {
261261

262262

263263
public function getElementById($identifier, $elements) {
264-
if (is_array($elements)) {
264+
if (\is_array($elements)) {
265265
$flag=false;
266266
$index=0;
267267
while ( !$flag && $index < sizeof($elements) ) {
@@ -279,7 +279,7 @@ public function getElementById($identifier, $elements) {
279279
}
280280

281281
protected function getElementByPropertyValue($propertyName,$value, $elements) {
282-
if (is_array($elements)) {
282+
if (\is_array($elements)) {
283283
$flag=false;
284284
$index=0;
285285
while ( !$flag && $index < sizeof($elements) ) {

Ajax/common/html/HtmlDoubleElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getContent() {
2828
}
2929

3030
public function addContent($content,$before=false) {
31-
if (is_array($this->content)===false) {
31+
if (!\is_array($this->content)) {
3232
if(isset($this->content))
3333
$this->content=array ($this->content);
3434
else
@@ -49,7 +49,7 @@ public function run(JsUtils $js) {
4949
parent::run($js);
5050
if ($this->content instanceof HtmlDoubleElement) {
5151
$this->content->run($js);
52-
} else if (is_array($this->content)) {
52+
} else if (\is_array($this->content)) {
5353
foreach ( $this->content as $itemContent ) {
5454
if ($itemContent instanceof HtmlDoubleElement) {
5555
$itemContent->run($js);

Ajax/common/html/HtmlSingleElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function __construct($identifier, $tagName="br") {
1313
}
1414

1515
public function setClass($classNames) {
16-
if(is_array($classNames)){
16+
if(\is_array($classNames)){
1717
$classNames=implode(" ", $classNames);
1818
}
1919
$this->setProperty("class", $classNames);

Ajax/common/html/PropertyWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static function wrap($input, $js=NULL, $separator=' ', $valueQuote='"') {
1111
if (is_string($input)) {
1212
$output=$input;
1313
}
14-
if (is_array($input)) {
14+
if (\is_array($input)) {
1515
if (sizeof($input) > 0) {
1616
if (self::containsElement($input) === false) {
1717
$output=self::wrapStrings($input, $js, $separator=' ', $valueQuote='"');
@@ -25,7 +25,7 @@ public static function wrap($input, $js=NULL, $separator=' ', $valueQuote='"') {
2525

2626
private static function containsElement($input) {
2727
foreach ( $input as $v ) {
28-
if (\is_object($v) === true || \is_array($v))
28+
if (\is_object($v) || \is_array($v))
2929
return true;
3030
}
3131
return false;

Ajax/common/html/traits/BaseHtmlEventsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefaul
3232
*/
3333
public function _addEvent($event, $jsCode) {
3434
if (array_key_exists($event, $this->_events)) {
35-
if (is_array($this->_events[$event])) {
35+
if (\is_array($this->_events[$event])) {
3636
$this->_events[$event][]=$jsCode;
3737
} else {
3838
$this->_events[$event]=array ($this->_events[$event],$jsCode );
@@ -69,7 +69,7 @@ public function addEventsOnRun(JsUtils $js=NULL) {
6969
if (isset($this->_bsComponent)) {
7070
foreach ( $this->_events as $event => $jsCode ) {
7171
$code=$jsCode;
72-
if (is_array($jsCode)) {
72+
if (\is_array($jsCode)) {
7373
$code="";
7474
foreach ( $jsCode as $jsC ) {
7575
if ($jsC instanceof AjaxCall) {

Ajax/common/traits/JqueryActionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function _animate($element='this', $params=array(), $speed='', $extra='',
6262
$speed=$this->_validate_speed($speed);
6363

6464
$animations="\t\t\t";
65-
if (is_array($params)) {
65+
if (\is_array($params)) {
6666
foreach ( $params as $param => $value ) {
6767
$animations.=$param.': \''.$value.'\', ';
6868
}

Ajax/php/cakephp/_JsUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function createScriptVariable(&$view,$view_var, $output){
3636
*/
3737
public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){
3838
\ob_start();
39-
if(isset($params) && \is_array($params)===false){
39+
if(isset($params) && !\is_array($params)){
4040
$params=[$params];
4141
}
4242
$url=h(Router::url(\array_merge([

Ajax/php/ci/JsUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function fromDispatcher($dispatcher){
5353
}
5454

5555
public function controller($controller, $name = '', $db_conn = FALSE){
56-
if (is_array($controller)){
56+
if (\is_array($controller)){
5757
foreach ($controller as $babe){
5858
$this->controller($babe);
5959
}

Ajax/php/yii/URI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function _fetch_uri_string() {
104104
}
105105

106106
// As a last ditch effort lets try using the $_GET array
107-
if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') {
107+
if (\is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') {
108108
$this->_set_uri_string(key($_GET));
109109
return;
110110
}

Ajax/semantic/components/search/SearchResults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function addResult($object) {
3131
}
3232

3333
public function addResults($objects) {
34-
if (\is_array($objects) === false) {
34+
if (!\is_array($objects)) {
3535
return $this->addResult($objects);
3636
}
3737
if (JArray::dimension($objects) === 1) {

0 commit comments

Comments
 (0)