Passed
Push — master ( 442876...4ec1bc )
by Felipe
15:55 queued 10:33
created

ArrayRecordSet::recordCount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/*
0 ignored issues
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
3
 * PHPPgAdmin v6.0.0-beta.30
4
 */
5
namespace PHPPgAdmin;
6
7
/**
8
 * Really simple RecordSet to allow printTable of arrays.
9
 *
10
 * $Id: ArrayRecordSet.php,v 1.3 2007/01/10 01:46:28 soranzo Exp $
11
 */
5 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
12
class ArrayRecordSet
13
{
14
    public $_array;
1 ignored issue
show
Coding Style introduced by
Public member variable "_array" must not be prefixed with an underscore
Loading history...
15
    public $_count;
1 ignored issue
show
Coding Style introduced by
Public member variable "_count" must not be prefixed with an underscore
Loading history...
16
    public $EOF = false;
17
    public $fields;
18
19
    public function __construct($data)
1 ignored issue
show
Coding Style introduced by
Missing function doc comment
Loading history...
20
    {
21
        $this->_array = $data;
22
        $this->_count = count($this->_array);
23
        $this->fields = reset($this->_array);
24
        if ($this->fields === false) {
25
            $this->EOF = true;
26
        }
27
    }
28
29
    public function recordCount()
1 ignored issue
show
Coding Style introduced by
Missing function doc comment
Loading history...
30
    {
31
        return $this->_count;
32
    }
33
34
    public function moveNext()
1 ignored issue
show
Coding Style introduced by
Missing function doc comment
Loading history...
35
    {
36
        $this->fields = next($this->_array);
37
        if ($this->fields === false) {
38
            $this->EOF = true;
39
        }
40
    }
41
}
42