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

src/classes/ArrayRecordSet.php (1 issue)

1
<?php
2
/*
0 ignored issues
show
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
 */
12
class ArrayRecordSet
13
{
14
    public $_array;
15
    public $_count;
16
    public $EOF = false;
17
    public $fields;
18
19
    public function __construct($data)
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()
30
    {
31
        return $this->_count;
32
    }
33
34
    public function moveNext()
35
    {
36
        $this->fields = next($this->_array);
37
        if ($this->fields === false) {
38
            $this->EOF = true;
39
        }
40
    }
41
}
42