This is breaking Parsoid's CI: (cf https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/628943)
> phan -p --allow-polyfill-parser --config-file=.phan/standalone.php --long-progress-bar 17:06:48 Parsing files... [...] 17:06:57 Analyzing methods... 17:06:59 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 722MB 17:06:59 Analyzing files... 17:06:59 ERROR: Error: Undefined constant 'ast\AST_LIST' in /workspace/src/services/parsoid/vendor/mediawiki/phan-taint-check-plugin/src/TaintednessBaseVisitor.php:972 17:06:59 Stack trace: 17:06:59 #0 /workspace/src/services/parsoid/vendor/mediawiki/phan-taint-check-plugin/src/TaintednessVisitor.php(527): TaintednessVisitor->getPhanObjsForNode(Object(ast\Node)) 17:06:59 #1 /workspace/src/services/parsoid/vendor/mediawiki/phan-taint-check-plugin/src/MWVisitor.php(834): TaintednessVisitor->visitAssign(Object(ast\Node)) 17:06:59 #2 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Plugin/ConfigPluginSet.php(1165): MWVisitor->visitAssign(Object(ast\Node)) 17:06:59 #3 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Plugin/ConfigPluginSet.php(1093): MWVisitor::Phan\Plugin\{closure}(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node), Array) 17:06:59 #4 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Plugin/ConfigPluginSet.php(298): Phan\Plugin\ConfigPluginSet::Phan\Plugin\{closure}(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node), Array) 17:06:59 #5 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(2497): Phan\Plugin\ConfigPluginSet->postAnalyzeNode(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node), Array) 17:06:59 #6 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(544): Phan\BlockAnalysisVisitor->postOrderAnalyze(Object(Phan\Language\Context), Object(ast\Node)) 17:06:59 #7 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(69): Phan\BlockAnalysisVisitor->visit(Object(ast\Node)) 17:06:59 #8 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(572): Phan\AST\Visitor\KindVisitorImplementation->visitAssign(Object(ast\Node)) 17:06:59 #9 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(233): Phan\BlockAnalysisVisitor->analyzeAndGetUpdatedContext(Object(Phan\Language\Context), Object(ast\Node), Object(ast\Node)) 17:06:59 #10 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(572): Phan\BlockAnalysisVisitor->visitStmtList(Object(ast\Node)) 17:06:59 #11 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(2378): Phan\BlockAnalysisVisitor->analyzeAndGetUpdatedContext(Object(Phan\Language\Context), Object(ast\Node), Object(ast\Node)) 17:06:59 #12 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(572): Phan\BlockAnalysisVisitor->visitMethod(Object(ast\Node)) 17:06:59 #13 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(233): Phan\BlockAnalysisVisitor->analyzeAndGetUpdatedContext(Object(Phan\Language\Context), Object(ast\Node), Object(ast\Node)) 17:06:59 #14 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(572): Phan\BlockAnalysisVisitor->visitStmtList(Object(ast\Node)) 17:06:59 #15 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(1337): Phan\BlockAnalysisVisitor->analyzeAndGetUpdatedContext(Object(Phan\Language\Context), Object(ast\Node), Object(ast\Node)) 17:06:59 #16 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(2346): Phan\BlockAnalysisVisitor->visitClosedContext(Object(ast\Node)) 17:06:59 #17 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(572): Phan\BlockAnalysisVisitor->visitClass(Object(ast\Node)) 17:06:59 #18 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/BlockAnalysisVisitor.php(233): Phan\BlockAnalysisVisitor->analyzeAndGetUpdatedContext(Object(Phan\Language\Context), Object(ast\Node), Object(ast\Node)) 17:06:59 #19 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(35): Phan\BlockAnalysisVisitor->visitStmtList(Object(ast\Node)) 17:06:59 #20 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Analysis.php(560): Phan\AST\Visitor\KindVisitorImplementation->__invoke(Object(ast\Node)) 17:06:59 #21 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Phan.php(526): Phan\Analysis::analyzeFile(Object(Phan\CodeBase), 'src/Config/Api/...', NULL, NULL) 17:06:59 #22 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Phan.php(583): Phan\Phan::Phan\{closure}(0, 'src/Config/Api/...', 232) 17:06:59 #23 /workspace/src/services/parsoid/vendor/phan/phan/src/Phan/Phan.php(376): Phan\Phan::finishAnalyzingRemainingStatements(Object(Phan\CodeBase), NULL, Array, Array) 17:06:59 #24 /workspace/src/services/parsoid/vendor/phan/phan/src/phan.php(36): Phan\Phan::analyzeFileList(Object(Phan\CodeBase), Object(Closure)) 17:06:59 #25 /workspace/src/services/parsoid/vendor/phan/phan/phan(9): require_once('/workspace/src/...') 17:06:59 #26 {main} 17:06:59 (Phan 2.6.1 crashed due to an uncaught Throwable when parsing/analyzing 'src/Config/Api/ApiHelper.php') 17:06:59 Script phan -p --allow-polyfill-parser --config-file=.phan/standalone.php --long-progress-bar handling the phan event returned with error code 1 17:06:59 Script @phan was called via test [...]
We keep running into variants of this bug, but this started appearing just today (a new version of phan-taint-check-plugin?). There have been no changes to src/Config/Api/ApiHelper.php since May 21, 2020 and no changes to composer.json since July 23, 2020.