Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
38 | public function execute(Candidate $candidate): bool |
||
39 | { |
||
40 | $this->lastError = null; |
||
41 | |||
42 | try { |
||
43 | $parsingResult = $this->parser->execute($candidate); |
||
44 | |||
45 | if (!empty($parsingResult)) { |
||
46 | $this->lastError = sprintf("Syntax error during processing of %s:\n%s", $candidate->getName(), $parsingResult); |
||
47 | |||
48 | return true; |
||
49 | } |
||
50 | } catch (ProcessTimedOutException $processTimedOutException) { |
||
51 | $this->lastError = $processTimedOutException->getMessage() . "\nHint: you can disable syntax checking for queries too big for processing"; |
||
52 | } |
||
53 | |||
54 | return false; |
||
55 | } |
||
56 | |||
74 |