Skip to content

Commit

Permalink
Crash fix
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Jan 9, 2024
1 parent 37e338a commit ec9bd90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8 -Djna.library.path=${{ env.Python3_ROOT_DIR }}"
SCALAPY_PYTHON_LIBRARY: "python311"
PHP_PARSER_BIN: "${{ env.GITHUB_WORKSPACE }}\platform\frontends\php2atom\vendor\bin\php-parse"
if: runner.os == 'Windows'
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ class PhpParser private (phpParserPath: String, phpIniPath: String):

val command = phpParseCommand(inputFilePath)

ExternalCommand.runMultiple(command, inputDirectory) match
ExternalCommand.run(command, inputDirectory, true) match
case Success(output) =>
processParserOutput(output, inputFilePath)

case Failure(exception) =>
logger.debug(s"Failure running php-parser with $command", exception.getMessage)
None

private def processParserOutput(output: String, filename: String): Option[PhpFile] =
private def processParserOutput(output: Seq[String], filename: String): Option[PhpFile] =
val maybeJson =
linesToJsonValue(output.split(System.lineSeparator()).toIndexedSeq, filename)
linesToJsonValue(output, filename)
maybeJson.flatMap(jsonValueToPhpFile(_, filename))

private def linesToJsonValue(lines: Seq[String], filename: String): Option[ujson.Value] =
Expand Down

0 comments on commit ec9bd90

Please sign in to comment.