Unable to parse file

Hi there,

Today I tried to get SonarCloud to scan my coding, however it has an fatal error which cannot parse 1 file and the whole coding package is missing on SonarCloud board

Below is the error log, anyone please help to let me know how should I change my code to bypass on this error ?

ERROR: Unable to parse file [file:///home/travis/build/rikibusiness/magento-upgrade/app/code/Nestle/Migration/Plugin/Declaration/Schema/Operations/AddComplexElementPlugin.php] at line 15
ERROR: Parse error at line 15 column 103:
5:
6:
7: use Magento\Framework\Setup\Declaration\Schema\ElementHistory;
8: use Nestle\Migration\Model\DataMigration;
9:
10: class AddComplexElementPlugin
11: {
12: public function aroundDoOperation($subject, callable $proceed, ElementHistory $elementHistory)
13: {
14: if (!is_null(DataMigration::$OUTPUT)) {
15: $table = $elementHistory->getNew() != null ? $elementHistory->getNew()->getName() : null();
^
16: if (in_array($table, [
17: “CATRULE_PRD_PRICE_RULE_DATE_WS_ID_CSTR_GROUP_ID_PRD_ID”,
18: “UNQ_EAA51B56FF092A0DCB795D1CEF812B7B”
19: ])) {
20: DataMigration::info("fixing wrong constrain " . $table);
21:
22: return ;
23: } else {
24: return $proceed($elementHistory);
25: }

Hi,

I created a ticket to fix this parsing error.

Still it’s weird that you call it “fatal error” and that “the whole coding package is missing on SonarCloud board”. Parsing error should only skip that file, other should appear in SQ.