Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab authored and github-actions[bot] committed Jul 29, 2024
1 parent 2d1245b commit 78989f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/FileDownloaders/FileDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function getTemporaryFile(string $url, ?TemporaryDirectory $tempor
],
]);

if (!$stream = @fopen($url, 'r', false, $context)) {
if (! $stream = @fopen($url, 'r', false, $context)) {
throw new Exception("Can't reach the url: {$url}");
}

Expand All @@ -31,7 +31,6 @@ public static function getTemporaryFile(string $url, ?TemporaryDirectory $tempor

fclose($stream);


if ($extension = File::extension($path)) {
$pathWithExtension = "{$path}.{$extension}";

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/FileDownloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
->create();

$path = FileDownloader::getTemporaryFile(
"https://icon.horse/icon/discord.com",
'https://icon.horse/icon/discord.com',
$temporaryDirectory
);

expect(is_file($path))->toBe(true);
expect(str($path)->endsWith(".png"))->toBe(true);
expect(str($path)->endsWith('.png'))->toBe(true);

$temporaryDirectory->delete();

Expand Down

0 comments on commit 78989f4

Please sign in to comment.