CollectionMock::getIteration()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
nop 0
1
<?php
2
/**
3
 * integer_net Magento Module
4
 *
5
 * @category   IntegerNet
6
 * @package    
7
 * @copyright  Copyright (c) 2015 integer_net GmbH (http://www.integer-net.de/)
8
 * @author     Fabian Schmengler <[email protected]>
9
 */
10
11
namespace IntegerNet\Anonymizer\Mock;
12
13
14
use IntegerNet\Anonymizer\Implementor\CollectionIterator;
15
16
/**
17
 * Dumb implementation of CollectionIterator that iterates over an array of data
18
 *
19
 * @package IntegerNet\Anonymizer\Mock
20
 */
21
class CollectionMock extends \ArrayIterator implements CollectionIterator
22
{
23
    const __CLASS = __CLASS__;
24
25
    /**
26
     * @param callable $callable
27
     * @return mixed
28
     */
29
    function walk(/*callable*/ $callable)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
30
    {
31
        foreach ($this as $row) {
32
            $callable($this);
33
        }
34
    }
35
36
    /**
37
     * Returns raw data from database
38
     *
39
     * @return mixed
40
     */
41
    function getRawData()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
42
    {
43
        return $this->current();
44
    }
45
46
    /**
47
     * Returns number of iteration
48
     *
49
     * @return int
50
     */
51
    function getIteration()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
52
    {
53
        return $this->key();
54
    }
55
56
    /**
57
     * Returns total size of collection
58
     *
59
     * @return mixed
60
     */
61
    function getSize()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
62
    {
63
        return $this->count();
64
    }
65
66
}