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

FatalErrorParser::parsingFoundResult()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2
Metric Value
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 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