From a5f05b40f5a00db593265808f5b5275dfe614b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sun, 8 Oct 2023 22:50:23 +0200 Subject: [PATCH] fix: Fix bad imports in the diff command --- src/Console/Command/Diff.php | 20 ++++++++++---------- src/Phar/PharDiff.php | 3 +-- src/Pharaoh/PharDiff.php | 2 +- tests/Console/Command/DiffTest.php | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Console/Command/Diff.php b/src/Console/Command/Diff.php index fec5b57bc..26f19da04 100644 --- a/src/Console/Command/Diff.php +++ b/src/Console/Command/Diff.php @@ -150,11 +150,11 @@ private function compareArchives(PharDiff $diff, IO $io): int { $io->comment('Comparing the two archives... (do not check the signatures)'); - $pharInfoA = $diff->getPharA(); - $pharInfoB = $diff->getPharB(); + $pharInfoA = $diff->getPharInfoA(); + $pharInfoB = $diff->getPharInfoB(); self::renderArchive( - $diff->getPharA()->getFileName(), + $diff->getPharInfoA()->getFileName(), $pharInfoA, $io, ); @@ -162,7 +162,7 @@ private function compareArchives(PharDiff $diff, IO $io): int $io->newLine(); self::renderArchive( - $diff->getPharB()->getFileName(), + $diff->getPharInfoB()->getFileName(), $pharInfoB, $io, ); @@ -203,19 +203,19 @@ private function compareContents(PharDiff $diff, IO $io): int $io->writeln(sprintf( '--- Files present in "%s" but not in "%s"', - $diff->getPharA()->getFileName(), - $diff->getPharB()->getFileName(), + $diff->getPharInfoA()->getFileName(), + $diff->getPharInfoB()->getFileName(), )); $io->writeln(sprintf( '+++ Files present in "%s" but not in "%s"', - $diff->getPharB()->getFileName(), - $diff->getPharA()->getFileName(), + $diff->getPharInfoB()->getFileName(), + $diff->getPharInfoA()->getFileName(), )); $io->newLine(); - self::renderPaths('-', $diff->getPharA(), $diffResult[0], $io); - self::renderPaths('+', $diff->getPharB(), $diffResult[1], $io); + self::renderPaths('-', $diff->getPharInfoA(), $diffResult[0], $io); + self::renderPaths('+', $diff->getPharInfoB(), $diffResult[1], $io); $io->error(sprintf( '%d file(s) difference', diff --git a/src/Phar/PharDiff.php b/src/Phar/PharDiff.php index ee892075a..a0b823258 100644 --- a/src/Phar/PharDiff.php +++ b/src/Phar/PharDiff.php @@ -12,9 +12,8 @@ * with this source code in the file LICENSE. */ -namespace KevinGH\Box\PharInfo; +namespace KevinGH\Box\Phar; -use KevinGH\Box\Phar\PharInfo; use KevinGH\Box\Pharaoh\PharDiff as ParagoniePharDiff; use SplFileInfo; use Symfony\Component\Finder\Finder; diff --git a/src/Pharaoh/PharDiff.php b/src/Pharaoh/PharDiff.php index 6a39f8758..8dec42e6b 100644 --- a/src/Pharaoh/PharDiff.php +++ b/src/Pharaoh/PharDiff.php @@ -43,8 +43,8 @@ namespace KevinGH\Box\Pharaoh; +use KevinGH\Box\Phar\IncompariblePhars; use KevinGH\Box\Phar\PharInfo; -use KevinGH\Box\PharInfo\IncompariblePhars; use ParagonIE\ConstantTime\Hex; use ParagonIE_Sodium_File; use RecursiveDirectoryIterator; diff --git a/tests/Console/Command/DiffTest.php b/tests/Console/Command/DiffTest.php index 9aae0eb21..53fbdd632 100644 --- a/tests/Console/Command/DiffTest.php +++ b/tests/Console/Command/DiffTest.php @@ -18,8 +18,8 @@ use Fidry\Console\DisplayNormalizer; use Fidry\Console\ExitCode; use InvalidArgumentException; +use KevinGH\Box\Phar\IncompariblePhars; use KevinGH\Box\Phar\InvalidPhar; -use KevinGH\Box\PharInfo\IncompariblePhars; use KevinGH\Box\Test\CommandTestCase; use KevinGH\Box\Test\RequiresPharReadonlyOff; use Symfony\Component\Console\Output\OutputInterface;