Skip to content

Commit

Permalink
fix: File the PHAR file size shown (#987)
Browse files Browse the repository at this point in the history
The file PHAR size shown previously was the one from the temporary PHAR
created which may differ in size (for example because we change the
alias).
  • Loading branch information
theofidry authored Apr 7, 2023
1 parent 7552b4d commit 55646ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Console/PharInfoRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static function renderContentsSummary(Pharaoh $pharInfo, IO $io): void
'<comment>Contents:</comment>%s (%s)',
1 === $totalCount ? ' 1 file' : " {$totalCount} files",
format_size(
filesize($pharInfo->getPhar()->getPath()),
filesize($pharInfo->getFile()),
),
),
);
Expand Down
26 changes: 13 additions & 13 deletions tests/Console/Command/InfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 1 file (6.65KB)
Contents: 1 file (6.62KB)
// Use the --list|-l option to list the content of the PHAR.

Expand All @@ -139,7 +139,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 2 files (6.64KB)
Contents: 2 files (6.61KB)
// Use the --list|-l option to list the content of the PHAR.

Expand Down Expand Up @@ -234,7 +234,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
// Use the --list|-l option to list the content of the PHAR.

Expand All @@ -260,7 +260,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
.hidden-file [NONE] - 0.00B
.hidden-dir/
Expand Down Expand Up @@ -302,7 +302,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
dir0/
fileA [NONE] - 0.00B
Expand Down Expand Up @@ -347,7 +347,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
.hidden-file [NONE] - 0.00B
.hidden-dir/
Expand Down Expand Up @@ -376,7 +376,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
dir0/
fileA [NONE] - 0.00B
Expand Down Expand Up @@ -407,7 +407,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
.hidden-file [NONE] - 0.00B
.hidden-dir/fileY [NONE] - 0.00B
Expand Down Expand Up @@ -443,7 +443,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
dir0/fileA [NONE] - 0.00B
dir0/dir02/dir020/fileE [NONE] - 0.00B
Expand Down Expand Up @@ -482,7 +482,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
.hidden-file [NONE] - 0.00B
.hidden-dir/fileY [NONE] - 0.00B
Expand Down Expand Up @@ -519,7 +519,7 @@ public static function inputProvider(): iterable
Metadata: None
Contents: 13 files (7.13KB)
Contents: 13 files (7.09KB)
fileX [NONE] - 0.00B
dir0/fileA [NONE] - 0.00B
dir0/dir02/dir020/fileE [NONE] - 0.00B
Expand Down Expand Up @@ -562,7 +562,7 @@ public static function inputProvider(): iterable
'test' => 123,
)
Contents: 3 files (6.79KB)
Contents: 3 files (6.75KB)
a/
bar.php [BZ2] - 60.00B
foo.php [NONE] - 19.00B
Expand Down Expand Up @@ -595,7 +595,7 @@ public static function inputProvider(): iterable
'test' => 123,
)
Contents: 3 files (6.79KB)
Contents: 3 files (6.75KB)
b/
beta/
bar.php [NONE] - 0.00B
Expand Down

0 comments on commit 55646ee

Please sign in to comment.