Skip to content

Commit

Permalink
Replace function sizeof (alias) by count.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information
jrbasso authored and markstory committed Nov 21, 2009
1 parent 52fcabc commit 71df8db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cake/libs/model/datasources/dbo/dbo_adodb.php
Expand Up @@ -216,7 +216,7 @@ function rollback(&$model) {
function listSources() { function listSources() {
$tables = $this->_adodb->MetaTables('TABLES'); $tables = $this->_adodb->MetaTables('TABLES');


if (!sizeof($tables) > 0) { if (!count($tables) > 0) {
trigger_error(ERROR_NO_TABLE_LIST, E_USER_NOTICE); trigger_error(ERROR_NO_TABLE_LIST, E_USER_NOTICE);
exit; exit;
} }
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/validation.php
Expand Up @@ -636,10 +636,10 @@ function multiple($check, $options = array()) {
if (empty($check)) { if (empty($check)) {
return false; return false;
} }
if ($options['max'] && sizeof($check) > $options['max']) { if ($options['max'] && count($check) > $options['max']) {
return false; return false;
} }
if ($options['min'] && sizeof($check) < $options['min']) { if ($options['min'] && count($check) < $options['min']) {
return false; return false;
} }
if ($options['in'] && is_array($options['in'])) { if ($options['in'] && is_array($options['in'])) {
Expand Down
6 changes: 3 additions & 3 deletions cake/tests/cases/libs/model/behaviors/acl.test.php
Expand Up @@ -285,7 +285,7 @@ function testAfterSave() {
$this->assertEqual($result['Aro']['parent_id'], 5); $this->assertEqual($result['Aro']['parent_id'], 5);


$node = $Person->node(array('model' => 'AclPerson', 'foreign_key' => 8)); $node = $Person->node(array('model' => 'AclPerson', 'foreign_key' => 8));
$this->assertEqual(sizeof($node), 2); $this->assertEqual(count($node), 2);
$this->assertEqual($node[0]['Aro']['parent_id'], 5); $this->assertEqual($node[0]['Aro']['parent_id'], 5);
$this->assertEqual($node[1]['Aro']['parent_id'], null); $this->assertEqual($node[1]['Aro']['parent_id'], null);
} }
Expand Down Expand Up @@ -315,7 +315,7 @@ function testAfterDelete() {
$Person->save($data); $Person->save($data);
$id = $Person->id; $id = $Person->id;
$node = $Person->node(); $node = $Person->node();
$this->assertEqual(sizeof($node), 2); $this->assertEqual(count($node), 2);
$this->assertEqual($node[0]['Aro']['parent_id'], 5); $this->assertEqual($node[0]['Aro']['parent_id'], 5);
$this->assertEqual($node[1]['Aro']['parent_id'], null); $this->assertEqual($node[1]['Aro']['parent_id'], null);


Expand Down Expand Up @@ -362,7 +362,7 @@ function testNode() {
$Person->id = 2; $Person->id = 2;
$result = $Person->node(); $result = $Person->node();
$this->assertTrue(is_array($result)); $this->assertTrue(is_array($result));
$this->assertEqual(sizeof($result), 1); $this->assertEqual(count($result), 1);
} }
} }
?> ?>

0 comments on commit 71df8db

Please sign in to comment.