Skip to content

refactor: Migrate Box FileSystem to Fidry FileSystem #1073

refactor: Migrate Box FileSystem to Fidry FileSystem

refactor: Migrate Box FileSystem to Fidry FileSystem #1073

Triggered via pull request October 7, 2023 07:43
Status Failure
Total duration 6m 5s
Artifacts

unit-tests.yaml

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

Annotations

2 errors and 10 warnings
Infection (PHP 8.1)
Process completed with exit code 2.
Unit tests status
Process completed with exit code 1.
Infection (PHP 8.1): src/Configuration/Configuration.php#L1862
Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ foreach ((array) $raw->{self::MAP_KEY} as $item) { $processed = []; foreach ($item as $match => $replace) { - $processed[Path::canonicalize(trim($match))] = Path::canonicalize(trim($replace)); + $processed[Path::canonicalize($match)] = Path::canonicalize(trim($replace)); } if (isset($processed['_empty_'])) { $processed[''] = $processed['_empty_'];
Infection (PHP 8.1): src/Configuration/Configuration.php#L1862
Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ foreach ((array) $raw->{self::MAP_KEY} as $item) { $processed = []; foreach ($item as $match => $replace) { - $processed[Path::canonicalize(trim($match))] = Path::canonicalize(trim($replace)); + $processed[Path::canonicalize(trim($match))] = Path::canonicalize($replace); } if (isset($processed['_empty_'])) { $processed[''] = $processed['_empty_'];
Infection (PHP 8.1): src/Configuration/Configuration.php#L2668
Escaped Mutant for Mutator "UnwrapArrayValues": --- Original +++ New @@ @@ private static function createPhpScoperCompactor(stdClass $raw, string $basePath, ConfigurationLogger $logger) : Compactor { $phpScoperConfig = self::configurePhpScoperPrefix(self::retrievePhpScoperConfig($raw, $basePath, $logger)); - $excludedFilePaths = array_values(array_unique(array_map(static fn(string $path): string => Path::makeRelative($path, $basePath), array_keys($phpScoperConfig->getExcludedFilesWithContents())))); + $excludedFilePaths = array_unique(array_map(static fn(string $path): string => Path::makeRelative($path, $basePath), array_keys($phpScoperConfig->getExcludedFilesWithContents()))); return new PhpScoperCompactor(new SerializableScoper($phpScoperConfig, ...$excludedFilePaths)); } private static function configurePhpScoperPrefix(PhpScoperConfiguration $phpScoperConfig) : PhpScoperConfiguration
Infection (PHP 8.1): src/Configuration/Configuration.php#L2669
Escaped Mutant for Mutator "UnwrapArrayUnique": --- Original +++ New @@ @@ private static function createPhpScoperCompactor(stdClass $raw, string $basePath, ConfigurationLogger $logger) : Compactor { $phpScoperConfig = self::configurePhpScoperPrefix(self::retrievePhpScoperConfig($raw, $basePath, $logger)); - $excludedFilePaths = array_values(array_unique(array_map(static fn(string $path): string => Path::makeRelative($path, $basePath), array_keys($phpScoperConfig->getExcludedFilesWithContents())))); + $excludedFilePaths = array_values(array_map(static fn(string $path): string => Path::makeRelative($path, $basePath), array_keys($phpScoperConfig->getExcludedFilesWithContents()))); return new PhpScoperCompactor(new SerializableScoper($phpScoperConfig, ...$excludedFilePaths)); } private static function configurePhpScoperPrefix(PhpScoperConfiguration $phpScoperConfig) : PhpScoperConfiguration
Infection (PHP 8.1): src/Configuration/Configuration.php#L2670
Escaped Mutant for Mutator "UnwrapArrayMap": --- Original +++ New @@ @@ private static function createPhpScoperCompactor(stdClass $raw, string $basePath, ConfigurationLogger $logger) : Compactor { $phpScoperConfig = self::configurePhpScoperPrefix(self::retrievePhpScoperConfig($raw, $basePath, $logger)); - $excludedFilePaths = array_values(array_unique(array_map(static fn(string $path): string => Path::makeRelative($path, $basePath), array_keys($phpScoperConfig->getExcludedFilesWithContents())))); + $excludedFilePaths = array_values(array_unique(array_keys($phpScoperConfig->getExcludedFilesWithContents()))); return new PhpScoperCompactor(new SerializableScoper($phpScoperConfig, ...$excludedFilePaths)); } private static function configurePhpScoperPrefix(PhpScoperConfiguration $phpScoperConfig) : PhpScoperConfiguration
Infection (PHP 8.1): src/Console/Command/Extract.php#L99
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $internal )); if ($canDelete) { - FS::remove($outputDir); + // Continue } else { // Do nothing
Infection (PHP 8.1): src/Console/Command/Extract.php#L107
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ return ExitCode::FAILURE; } } - FS::mkdir($outputDir); + try { self::dumpPhar($pharPath, $outputDir); } catch (InvalidPhar $invalidPhar) {
Infection (PHP 8.1): src/Console/Command/Extract.php#L156
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ $pubKeyContent = null; $tmpPubKey = $tmpFile . '.pubkey'; try { - FS::copy($file, $tmpFile, true); + FS::copy($file, $tmpFile, false); if (file_exists($pubKey)) { FS::copy($pubKey, $tmpPubKey, true); $pubKeyContent = FS::getFileContents($pubKey);
Infection (PHP 8.1): src/Console/Command/Extract.php#L159
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ try { FS::copy($file, $tmpFile, true); if (file_exists($pubKey)) { - FS::copy($pubKey, $tmpPubKey, true); + FS::copy($pubKey, $tmpPubKey, false); $pubKeyContent = FS::getFileContents($pubKey); } $phar = PharFactory::create($tmpFile);
Infection (PHP 8.1): src/Console/Command/Extract.php#L168
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ $pharMeta = PharMeta::fromPhar($phar, $pubKeyContent); $phar->extractTo($tmpDir); } catch (Throwable $throwable) { - FS::remove([$tmpFile, $tmpPubKey]); + FS::remove([$tmpPubKey]); throw $throwable; } FS::dumpFile($tmpDir . DIRECTORY_SEPARATOR . self::PHAR_META_PATH, $pharMeta->toJson());