Completed
Push — work-fleets ( 6b7253...c0452c )
by SuperNova.WS
06:17
created

DbEmptyIterator   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 68
ccs 0
cts 13
cp 0
rs 10
wmc 7
lcom 1
cbo 1

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A current() 0 3 1
A next() 0 3 1
A key() 0 3 1
A valid() 0 3 1
A rewind() 0 3 1
A fetchCurrentRow() 0 4 1
1
<?php
2
3
/**
4
 * Class DbEmptyIterator
5
 *
6
 * Empty iterator
7
 */
8
class DbEmptyIterator extends DbResultIterator {
9
10
  /**
11
   * Constructor
12
   *
13
   * @param mixed $result
14
   * @param int   $fetchMode constant (MYSQLI_ASSOC, MYSQLI_NUM, MYSQLI_BOTH)
15
   */
16
  public function __construct($result = false, $fetchMode = MYSQLI_ASSOC) {
17
    // Empty constructor
18
  }
19
20
  /**
21
   * Return the current element
22
   * @link http://php.net/manual/en/iterator.current.php
23
   * @return mixed Can return any type.
24
   * @since 5.0.0
25
   */
26
  public function current() {
27
    return null;
28
  }
29
30
  /**
31
   * Move forward to next element
32
   * @link http://php.net/manual/en/iterator.next.php
33
   * @return void Any returned value is ignored.
34
   * @since 5.0.0
35
   */
36
  public function next() {
37
    // Doing nothing
38
  }
39
40
  /**
41
   * Return the key of the current element
42
   * @link http://php.net/manual/en/iterator.key.php
43
   * @return mixed scalar on success, or null on failure.
44
   * @since 5.0.0
45
   */
46
  public function key() {
47
    return null;
48
  }
49
50
  /**
51
   * Checks if current position is valid
52
   * @link http://php.net/manual/en/iterator.valid.php
53
   * @return boolean The return value will be casted to boolean and then evaluated.
54
   * Returns true on success or false on failure.
55
   * @since 5.0.0
56
   */
57
  public function valid() {
58
    return false;
59
  }
60
61
  /**
62
   * Rewind the Iterator to the first element
63
   * @link http://php.net/manual/en/iterator.rewind.php
64
   * @return void Any returned value is ignored.
65
   * @since 5.0.0
66
   */
67
  public function rewind() {
68
    // Doing nothing
69
  }
70
71
  protected function fetchCurrentRow() {
72
    // TODO: Implement fetchCurrentRow() method.
73
    $this->currentRow = false;
0 ignored issues
show
Documentation Bug introduced by
It seems like false of type false is incompatible with the declared type array of property $currentRow.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
74
  }
75
}