Skip to content

Commit 87d0aed

Browse files
driesvintsgithub-actions[bot]
authored andcommitted
Fix code styling
1 parent f779116 commit 87d0aed

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

app/Jobs/GenerateSocialShareImage.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,17 @@ public function handle(): Response
3232
$text = wordwrap($this->article->title(), self::CHARACTERS_PER_LINE);
3333

3434
return Cache::remember(
35-
'articleSocialImage-' . $this->article->id,
35+
'articleSocialImage-'.$this->article->id,
3636
now()->addDay(),
37-
fn () =>
38-
response(
39-
$image->read(resource_path('images/' . self::TEMPLATE))
40-
->text($text, self::TEXT_X_POSITION, self::TEXT_Y_POSITION, function ($font) {
41-
$font->file(resource_path('fonts/' . self::FONT));
42-
$font->size(self::FONT_SIZE);
43-
$font->color(self::TEXT_COLOUR);
44-
})
45-
->toPng()
46-
)->header('Content-Type', 'image/png')
37+
fn () => response(
38+
$image->read(resource_path('images/'.self::TEMPLATE))
39+
->text($text, self::TEXT_X_POSITION, self::TEXT_Y_POSITION, function ($font) {
40+
$font->file(resource_path('fonts/'.self::FONT));
41+
$font->size(self::FONT_SIZE);
42+
$font->color(self::TEXT_COLOUR);
43+
})
44+
->toPng()
45+
)->header('Content-Type', 'image/png')
4746
->header('Cache-Control', 'max-age=86400, public')
4847
);
4948
}

tests/Integration/Jobs/GenerateSocialShareImageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
test('social image is generated for articles', function () {
1313
$article = Article::factory()->create([
14-
'title' => 'This is an article to test social share image generation'
14+
'title' => 'This is an article to test social share image generation',
1515
]);
1616

17-
$generatedSocialShareImagePath = sys_get_temp_dir() . '/generated_social_share_temporary_image.png';
17+
$generatedSocialShareImagePath = sys_get_temp_dir().'/generated_social_share_temporary_image.png';
1818

1919
file_put_contents(
2020
$generatedSocialShareImagePath,
@@ -24,7 +24,7 @@
2424
expect(
2525
Pixelmatch::new(
2626
$generatedSocialShareImagePath,
27-
__DIR__ . "/stubs/generate_social_share_image.png"
27+
__DIR__.'/stubs/generate_social_share_image.png'
2828
)->matches()
2929
)->toBeTrue();
3030

0 commit comments

Comments
 (0)