snyk 1.1271.0 → 1.1272.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189564,16 +189564,31 @@ function stripUndefinedLabels(parserResult) {
189564
189564
 
189565
189565
  Object.defineProperty(exports, "__esModule", ({ value: true }));
189566
189566
  exports.phpFilesToScannedProjects = void 0;
189567
- const lockFileParser = __webpack_require__(59794);
189568
189567
  const dep_graph_1 = __webpack_require__(71479);
189569
189568
  const path = __webpack_require__(71017);
189569
+ const composer_lockfile_parser_1 = __webpack_require__(59794);
189570
+ const errors_1 = __webpack_require__(18920);
189570
189571
  const PACKAGE_MANAGER_TYPE = "composer";
189571
189572
  async function phpFilesToScannedProjects(filePathToContent) {
189572
189573
  const scanResults = [];
189573
189574
  const filePairs = findManifestLockPairsInSameDirectory(filePathToContent);
189574
189575
  const shouldIncludeDevDependencies = false;
189575
189576
  for (const pathPair of filePairs) {
189576
- const parserResult = await lockFileParser.buildDepTree(filePathToContent[pathPair.lock], filePathToContent[pathPair.manifest], pathPair.manifest, {}, shouldIncludeDevDependencies);
189577
+ let parserResult;
189578
+ try {
189579
+ parserResult = (0, composer_lockfile_parser_1.buildDepTree)(filePathToContent[pathPair.lock], filePathToContent[pathPair.manifest], pathPair.manifest, {}, shouldIncludeDevDependencies);
189580
+ }
189581
+ catch (e) {
189582
+ // This will skip parsing all files that error due to being malformed.
189583
+ // If we do not do this, the entire scan will fail.
189584
+ // Ideally, we'd like to log this, but logging does not exist in this library.
189585
+ if (e instanceof errors_1.InvalidUserInputError) {
189586
+ continue;
189587
+ }
189588
+ else {
189589
+ throw e;
189590
+ }
189591
+ }
189577
189592
  const depGraph = await dep_graph_1.legacy.depTreeToGraph(parserResult, PACKAGE_MANAGER_TYPE);
189578
189593
  const depGraphFact = {
189579
189594
  type: "depGraph",