NullMetadataIterator::key()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of alchemy/resource-component.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Alchemy\Resource\Metadata;
13
14
class NullMetadataIterator implements MetadataIterator
15
{
16
17
    /**
18
     * (PHP 5 &gt;= 5.0.0)<br/>
19
     * Move forward to next element
20
     * @link http://php.net/manual/en/iterator.next.php
21
     * @return void Any returned value is ignored.
22
     */
23 4
    public function next()
24
    {
25 4
        return;
26
    }
27
28
    /**
29
     * (PHP 5 &gt;= 5.0.0)<br/>
30
     * Return the key of the current element
31
     * @link http://php.net/manual/en/iterator.key.php
32
     * @return mixed scalar on success, or null on failure.
33
     */
34 4
    public function key()
35
    {
36 4
        return null;
37
    }
38
39
    /**
40
     * (PHP 5 &gt;= 5.0.0)<br/>
41
     * Checks if current position is valid
42
     * @link http://php.net/manual/en/iterator.valid.php
43
     * @return boolean The return value will be casted to boolean and then evaluated.
44
     * Returns true on success or false on failure.
45
     */
46 8
    public function valid()
47
    {
48 8
        return false;
49
    }
50
51
    /**
52
     * (PHP 5 &gt;= 5.0.0)<br/>
53
     * Rewind the Iterator to the first element
54
     * @link http://php.net/manual/en/iterator.rewind.php
55
     * @return void Any returned value is ignored.
56
     */
57 8
    public function rewind()
58
    {
59 8
        return;
60
    }
61
62
    /**
63
     * @return Metadata
64
     */
65 4
    public function current()
66
    {
67 4
        throw new \BadMethodCallException();
68
    }
69
}
70