Skip to content

Commit 8d2a11b

Browse files
authored
Replace remaining "sizeof" calls with "count" (#2369)
1 parent 569d14d commit 8d2a11b

File tree

25 files changed

+53
-44
lines changed

25 files changed

+53
-44
lines changed

app/design/adminhtml/default/default/template/dashboard/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
?>
2727
<?php
2828

29-
$numColumns = sizeof($this->getColumns());
29+
$numColumns = count($this->getColumns());
3030
?>
3131
<?php if($this->getCollection()): ?>
3232
<div class="grid np">

app/design/adminhtml/default/default/template/dashboard/salebar.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
2525
*/
2626
?>
27-
<?php if( sizeof($this->getTotals()) > 0 ): ?>
27+
<?php if(count($this->getTotals()) > 0): ?>
2828
<?php foreach( $this->getTotals() as $_total ): ?>
2929
<div class="entry-edit">
3030
<div class="entry-edit-head"><h4><?php echo $_total['label'] ?></h4></div>

app/design/adminhtml/default/default/template/dashboard/totalbar.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
2525
*/
2626
?>
27-
<?php if( sizeof($this->getTotals()) > 0 ): ?>
27+
<?php if(count($this->getTotals()) > 0): ?>
2828
<div class="box" id="dashboard_diagram_totals">
2929
<div class="entry-edit">
3030
<table cellspacing="0" width="100%">

app/design/adminhtml/default/default/template/report/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* getPagerVisibility()
3535
* getVarNamePage()
3636
*/
37-
$numColumns = sizeof($this->getColumns());
37+
$numColumns = count($this->getColumns());
3838
?>
3939
<?php if($this->getCollection()): ?>
4040
<?php if($this->canDisplayContainer()): ?>

app/design/adminhtml/default/default/template/sales/order/totalbar.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
2525
*/
2626
?>
27-
<?php if( sizeof($this->getTotals()) > 0 ): ?>
27+
<?php if(count($this->getTotals()) > 0): ?>
2828
<div class="box">
2929
<div class="entry-edit">
3030
<table border="0" cellspacing="0" width="100%">

app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ $_rates = ( $_newRates ) ? $_newRates : $_oldRates;
3737
<thead>
3838
<tr class="headings">
3939
<th class="a-right">&nbsp;</th>
40-
<?php $_i = 0; foreach( $this->getAllowedCurrencies() as $_currencyCode ): ?>
41-
<th class="<?php echo (( ++$_i == (sizeof($this->getAllowedCurrencies())) ) ? 'last' : '' ) ?> a-right"><strong><?php echo $this->escapeHtml($_currencyCode) ?><strong></th>
40+
<?php $_allowedCurrencies = $this->getAllowedCurrencies(); ?>
41+
<?php $_allowedCurrencyCount = count($_allowedCurrencies); ?>
42+
<?php $_i = 0; foreach($_allowedCurrencies as $_currencyCode): ?>
43+
<th class="<?php echo ((++$_i === $_allowedCurrencyCount) ? 'last' : '' ) ?> a-right"><strong><?php echo $this->escapeHtml($_currencyCode) ?><strong></th>
4244
<?php endforeach ?>
4345
</tr>
4446
</thead>

app/design/adminhtml/default/default/template/widget/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* getPagerVisibility()
3636
* getVarNamePage()
3737
*/
38-
$numColumns = sizeof($this->getColumns());
38+
$numColumns = count($this->getColumns());
3939
?>
4040
<?php if($this->getCollection()): ?>
4141
<?php if($this->canDisplayContainer()): ?>

app/design/frontend/base/default/template/catalog/product/list.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
*/
3333
?>
3434
<?php
35-
$_productCollection=$this->getLoadedProductCollection();
35+
$_productCollection = $this->getLoadedProductCollection();
36+
$_productCollectionCount = count($_productCollection);
3637
$_helper = $this->helper('catalog/output');
3738
$_params = $this->escapeHtml(json_encode(array('form_key' => $this->getFormKey())));
3839
?>
@@ -46,7 +47,7 @@
4647
<?php $_iterator = 0; ?>
4748
<ol class="products-list" id="products-list">
4849
<?php foreach ($_productCollection as $_product): ?>
49-
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif ?>">
50+
<li class="item<?php if(++$_iterator === $_productCollectionCount): ?> last<?php endif ?>">
5051
<?php // Product Image ?>
5152
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
5253
<?php // Product description ?>

app/design/frontend/base/default/template/catalogsearch/term.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class="page-title">
2828
<h1><?php echo $this->__('Popular Search Terms') ?></h1>
2929
</div>
30-
<?php if( sizeof($this->getTerms()) > 0 ): ?>
30+
<?php if(count($this->getTerms()) > 0): ?>
3131
<ul class="tags-list">
3232
<?php foreach ($this->getTerms() as $_term): ?>
3333
<li><a href="<?php echo $this->getSearchUrl($_term) ?>" style="font-size:<?php echo $_term->getRatio()*70+75 ?>%;"><?php echo $this->escapeHtml($_term->getName()) ?></a></li>

app/design/frontend/base/default/template/sales/order/recent.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
<?php $_orders = $this->getOrders(); ?>
2929
<div class="box-head">
3030
<h2><?php echo $this->__('Recent Orders') ?></h2>
31-
<?php if( sizeof($_orders->getItems()) > 0 ): ?><a href="<?php echo $this->getUrl('sales/order/history') ?>"><?php echo $this->__('View All') ?></a><?php endif ?>
31+
<?php if(count($_orders->getItems()) > 0): ?><a href="<?php echo $this->getUrl('sales/order/history') ?>"><?php echo $this->__('View All') ?></a><?php endif ?>
3232
</div>
33-
<?php if( sizeof($_orders->getItems()) > 0 ): ?>
33+
<?php if(count($_orders->getItems()) > 0): ?>
3434
<table class="data-table" id="my-orders-table">
3535
<col width="1" />
3636
<col width="1" />

0 commit comments

Comments
 (0)