Completed
Push — output_parsers_refactor ( 9ffc6c...755930 )
by Alessandro
09:57
created

FatalErrorParser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parsingFoundResult() 0 10 2
1
<?php
2
3
namespace Paraunit\Parser;
4
5
use Paraunit\Process\ProcessResultInterface;
6
7
class FatalErrorParser extends AbstractParser implements JSONParserChainElementInterface
8
{
9
    const TAG = 'fatal';
10
    const TITLE = 'Fatal Errors';
11
    const PARSING_REGEX = '/Fatal error(?s:.)*/';
12
13
    /**
14
     * @param ProcessResultInterface $process
15
     *
16
     * @return bool True if chain should continue
17
     */
18 11
    public function parsingFoundResult(ProcessResultInterface $process)
19
    {
20 11
        if ($this->parsingFoundSomething($process)) {
21 2
            $process->reportFatalError();
22
23 2
            return false;
24
        }
25
26 9
        return true;
27
    }
28
}
29