ErrorFreePhpParser::parse()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Padawan\Parser;
4
5
use PhpParser\Parser\Php5 as ASTGenerator;
6
7
class ErrorFreePhpParser extends ASTGenerator {
8
    public function parse($content) {
9
        try {
10
            return parent::parse($content);
11
        }
12
        catch (\Exception $e) {
13
            return $this->semValue;
14
        }
15
    }
16
}
17