public static function fromCheckAndCodeParseFailure(CheckInterface $check, ParseErrorException $e, $file)
    {
        return new static(
            $check->getName(),
            sprintf('File: "%s" could not be parsed. Error: "%s"', $file, $e->getMessage())
        );
    }
public static function fromCheckAndCodeParseFailure(CheckInterface $check, ParseErrorException $e, $file)
    {
        return new static(
            $check->getName(),
            sprintf('File: "%s" could not be parsed. Error: "%s"', $file, $e->getMessage())
        );
    }
public static function fromCheckAndCodeParseFailure ( CheckInterface $ check , ParseErrorException $ e , $ file ) { return new static ( $ check -> getName ( ) , sprintf ( 'File: "%s" could not be parsed. Error: "%s"' , $ file , $ e -> getMessage ( ) ) ) ; }
Static constructor to create from a `PhpParser\Error` exception. Many checks will need to parse the student's
solution, so this serves as a helper to create a consistent failure.

@param CheckInterface $check The check that attempted to parse the solution.
@param ParseErrorException $e The parse exception.
@param string $file The absolute path to the solution.
@return static The result.
Static constructor to create from a PhpParser \ Error exception . Many checks will need to parse the student s solution so this serves as a helper to create a consistent failure .