feat: Include the original file name in the Phar error #1089
unit-tests.yaml
on: pull_request
Matrix: infection
Matrix: unit-tests
Unit tests status
0s
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')) {
|