Completed
Push — master ( 9b7a15...5a005f )
by Sam
01:38
created

StringIterator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ord() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Badcow\DNS\Parser;
4
5
class StringIterator extends \ArrayIterator
6
{
7
    /**
8
     * StringIterator constructor.
9
     *
10
     * @param string $string
11
     */
12
    public function __construct(string $string)
13
    {
14
        parent::__construct(str_split($string));
15
    }
16
17
    /**
18
     * @return int
19
     */
20
    public function ord(): int
21
    {
22
        return ord($this->current());
23
    }
24
}
25