Any   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A parse() 0 7 2
1
<?php
2
3
namespace Vanderlee\Comprehend\Parser\Terminal;
4
5
use Vanderlee\Comprehend\Core\Context;
6
use Vanderlee\Comprehend\Parser\Parser;
7
8
/**
9
 * Matches any single symbol.
10
 *
11
 * @author Martijn
12
 */
13
class Any extends Parser
14
{
15 5
    protected function parse(&$input, $offset, Context $context)
16
    {
17 5
        if ($offset < mb_strlen($input)) {
18 3
            return $this->success($input, $offset, 1);
19
        }
20
21 2
        return $this->failure($input, $offset);
22
    }
23
24 5
    public function __toString()
25
    {
26 5
        return '.';
27
    }
28
}
29