Replace function sizeof (alias) by count.

Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
Juan Basso 2009-11-19 20:27:09 -02:00 committed by mark_story
parent 52fcabc96a
commit 71df8dbbba
3 changed files with 6 additions and 6 deletions

View file

@ -216,7 +216,7 @@ class DboAdodb extends DboSource {
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;
} }

View file

@ -636,10 +636,10 @@ class Validation extends Object {
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'])) {

View file

@ -285,7 +285,7 @@ class AclBehaviorTestCase extends CakeTestCase {
$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);
} }
@ -315,7 +315,7 @@ class AclBehaviorTestCase extends CakeTestCase {
$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);
@ -362,7 +362,7 @@ class AclBehaviorTestCase extends CakeTestCase {
$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);
} }
} }
?> ?>