Skip to content

feat: Include the original file name in the Phar error #1089

feat: Include the original file name in the Phar error

feat: Include the original file name in the Phar error #1089

Triggered via pull request October 8, 2023 20:09
Status Failure
Total duration 5m 41s
Artifacts

unit-tests.yaml

on: pull_request
Matrix: infection
Matrix: unit-tests
Unit tests status
0s
Unit tests status
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 1 warning
Infection (PHP 8.1)
Process completed with exit code 2.
Unit tests status
Process completed with exit code 1.
Infection (PHP 8.1): src/Phar/InvalidPhar.php#L132
Escaped Mutant for Mutator "NullSafeMethodCall": --- Original +++ New @@ @@ $pharObject = $isPharData ? 'PharData' : 'Phar'; } $errorMessageStart = sprintf('Could not create a %s instance for the file "%s"%s', $pharObject, $file, null === $originalFile ? '' : sprintf(' (of the original file "%s")', $originalFile)); - $message = $throwable?->getMessage() ?? ''; + $message = $throwable->getMessage() ?? ''; if ($throwable instanceof UnexpectedValueException) { // https://github.com/php/php-src/blob/930db2b2d315b2acc917706cf76bed8b09f94b79/ext/phar/phar.c#L1330 if (str_ends_with($message, 'file extension (or combination) not recognised or the directory does not exist')) {