mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Replace function sizeof (alias) by count.
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
52fcabc96a
commit
71df8dbbba
3 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue