From 71df8dbbba8ace80cd60b9019fc3ab65cca1df81 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Thu, 19 Nov 2009 20:27:09 -0200 Subject: [PATCH] Replace function sizeof (alias) by count. Signed-off-by: Mark Story --- cake/libs/model/datasources/dbo/dbo_adodb.php | 2 +- cake/libs/validation.php | 4 ++-- cake/tests/cases/libs/model/behaviors/acl.test.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_adodb.php b/cake/libs/model/datasources/dbo/dbo_adodb.php index 45fa4048e..7feda9885 100644 --- a/cake/libs/model/datasources/dbo/dbo_adodb.php +++ b/cake/libs/model/datasources/dbo/dbo_adodb.php @@ -216,7 +216,7 @@ class DboAdodb extends DboSource { function listSources() { $tables = $this->_adodb->MetaTables('TABLES'); - if (!sizeof($tables) > 0) { + if (!count($tables) > 0) { trigger_error(ERROR_NO_TABLE_LIST, E_USER_NOTICE); exit; } diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 6531d97d9..22a1d1f62 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -636,10 +636,10 @@ class Validation extends Object { if (empty($check)) { return false; } - if ($options['max'] && sizeof($check) > $options['max']) { + if ($options['max'] && count($check) > $options['max']) { return false; } - if ($options['min'] && sizeof($check) < $options['min']) { + if ($options['min'] && count($check) < $options['min']) { return false; } if ($options['in'] && is_array($options['in'])) { diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index 3ca1974e3..4c8f70750 100644 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -285,7 +285,7 @@ class AclBehaviorTestCase extends CakeTestCase { $this->assertEqual($result['Aro']['parent_id'], 5); $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[1]['Aro']['parent_id'], null); } @@ -315,7 +315,7 @@ class AclBehaviorTestCase extends CakeTestCase { $Person->save($data); $id = $Person->id; $node = $Person->node(); - $this->assertEqual(sizeof($node), 2); + $this->assertEqual(count($node), 2); $this->assertEqual($node[0]['Aro']['parent_id'], 5); $this->assertEqual($node[1]['Aro']['parent_id'], null); @@ -362,7 +362,7 @@ class AclBehaviorTestCase extends CakeTestCase { $Person->id = 2; $result = $Person->node(); $this->assertTrue(is_array($result)); - $this->assertEqual(sizeof($result), 1); + $this->assertEqual(count($result), 1); } } ?> \ No newline at end of file