Permalink
Browse files

Replace function sizeof (alias) by count.

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent 52fcabc commit 71df8dbbba8ace80cd60b9019fc3ab65cca1df81 @jrbasso jrbasso committed with markstory Nov 19, 2009
@@ -216,7 +216,7 @@ function rollback(&$model) {
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;
}
View
@@ -636,10 +636,10 @@ function multiple($check, $options = array()) {
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'])) {
@@ -285,7 +285,7 @@ function testAfterSave() {
$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 @@ function testAfterDelete() {
$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 @@ function testNode() {
$Person->id = 2;
$result = $Person->node();
$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.