Skip to content

Commit c94bde6

Browse files
committed
fix php cs
1 parent 84b0560 commit c94bde6

11 files changed

+35
-63
lines changed

src/Type.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function __construct(?string $title = null)
1414
{
1515
$this->setProperty('og', 'type', $this->type);
1616

17-
if(is_string($title)) {
17+
if (is_string($title)) {
1818
$this->title($title);
1919
}
2020
}

src/Types/Music/Album.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function musician(string $url)
2121
public function song(string $url, ?int $disc = null, ?int $track = null)
2222
{
2323
$this->addProperty(self::PREFIX, 'song', $url);
24-
$this->when($disc > 0, fn() => $this->addProperty(self::PREFIX, 'song:disc', $disc));
25-
$this->when($track > 0, fn() => $this->addProperty(self::PREFIX, 'song:track', $track));
24+
$this->when($disc > 0, fn () => $this->addProperty(self::PREFIX, 'song:disc', $disc));
25+
$this->when($track > 0, fn () => $this->addProperty(self::PREFIX, 'song:track', $track));
2626

2727
return $this;
2828
}

src/Types/Music/Playlist.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public function creator(string $url)
2020
public function song(string $url, ?int $disc = null, ?int $track = null)
2121
{
2222
$this->addProperty(self::PREFIX, 'song', $url);
23-
$this->when($disc > 0, fn() => $this->addProperty(self::PREFIX, 'song:disc', $disc));
24-
$this->when($track > 0, fn() => $this->addProperty(self::PREFIX, 'song:track', $track));
23+
$this->when($disc > 0, fn () => $this->addProperty(self::PREFIX, 'song:disc', $disc));
24+
$this->when($track > 0, fn () => $this->addProperty(self::PREFIX, 'song:track', $track));
2525

2626
return $this;
2727
}

src/Types/Music/Song.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function musician(string $url)
2727
public function album(string $url, ?int $disc = null, ?int $track = null)
2828
{
2929
$this->addProperty(self::PREFIX, 'album', $url);
30-
$this->when($disc > 0, fn() => $this->addProperty(self::PREFIX, 'album:disc', $disc));
31-
$this->when($track > 0, fn() => $this->addProperty(self::PREFIX, 'album:track', $track));
30+
$this->when($disc > 0, fn () => $this->addProperty(self::PREFIX, 'album:disc', $disc));
31+
$this->when($track > 0, fn () => $this->addProperty(self::PREFIX, 'album:track', $track));
3232

3333
return $this;
3434
}

src/Types/Video/Episode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function series(string $url)
2121
public function actor(string $url, ?string $role = null)
2222
{
2323
$this->addProperty(self::PREFIX, 'actor', $url);
24-
$this->when($role, fn() => $this->addProperty(self::PREFIX, 'actor:role', $role));
24+
$this->when($role, fn () => $this->addProperty(self::PREFIX, 'actor:role', $role));
2525

2626
return $this;
2727
}

src/Types/Video/Movie.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Movie extends Type
1414
public function actor(string $url, ?string $role = null)
1515
{
1616
$this->addProperty(self::PREFIX, 'actor', $url);
17-
$this->when($role, fn() => $this->addProperty(self::PREFIX, 'actor:role', $role));
17+
$this->when($role, fn () => $this->addProperty(self::PREFIX, 'actor:role', $role));
1818

1919
return $this;
2020
}

src/Types/Video/Other.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Other extends Type
1414
public function actor(string $url, ?string $role = null)
1515
{
1616
$this->addProperty(self::PREFIX, 'actor', $url);
17-
$this->when($role, fn() => $this->addProperty(self::PREFIX, 'actor:role', $role));
17+
$this->when($role, fn () => $this->addProperty(self::PREFIX, 'actor:role', $role));
1818

1919
return $this;
2020
}

src/Types/Video/TvShow.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TvShow extends Type
1414
public function actor(string $url, ?string $role = null)
1515
{
1616
$this->addProperty(self::PREFIX, 'actor', $url);
17-
$this->when($role, fn() => $this->addProperty(self::PREFIX, 'actor:role', $role));
17+
$this->when($role, fn () => $this->addProperty(self::PREFIX, 'actor:role', $role));
1818

1919
return $this;
2020
}

tests/GlobalTypesTest.php

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
use Astrotomic\OpenGraph\Type;
43
use Astrotomic\OpenGraph\Types\Article;
54
use Astrotomic\OpenGraph\Types\Book;
65
use Astrotomic\OpenGraph\Types\Profile;
@@ -13,10 +12,9 @@
1312
->locale('en_US')
1413
->alternateLocale('en_GB')
1514
->siteName('Example')
16-
->image('http://www.example.com/image1.jpg')
17-
;
15+
->image('http://www.example.com/image1.jpg');
1816

19-
assertMatchesHtmlSnapshot((string)$og);
17+
assertMatchesHtmlSnapshot((string) $og);
2018
})->group('global');
2119

2220
it('can generate article tags', function () {
@@ -32,10 +30,9 @@
3230
->modifiedAt(new DateTime('2020-06-07 20:00:00'))
3331
->author('http://www.example.com/author')
3432
->section('Technology')
35-
->tag('PHP')
36-
;
33+
->tag('PHP');
3734

38-
assertMatchesHtmlSnapshot((string)$og);
35+
assertMatchesHtmlSnapshot((string) $og);
3936
})->group('global');
4037

4138
it('can generate book tags', function () {
@@ -50,10 +47,9 @@
5047
->releasedAt(new DateTime('2020-06-05'))
5148
->isbn('978-3-86680-192-9')
5249
->author('http://www.example.com/author')
53-
->tag('PHP')
54-
;
50+
->tag('PHP');
5551

56-
assertMatchesHtmlSnapshot((string)$og);
52+
assertMatchesHtmlSnapshot((string) $og);
5753
})->group('global');
5854

5955
it('can generate profile tags', function () {
@@ -68,8 +64,7 @@
6864
->firstName('Jane')
6965
->lastName('Doe')
7066
->username('janedoe')
71-
->gender('female')
72-
;
67+
->gender('female');
7368

74-
assertMatchesHtmlSnapshot((string)$og);
69+
assertMatchesHtmlSnapshot((string) $og);
7570
})->group('global');

tests/MusicTypesTest.php

+8-22
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
<?php
22

3-
use Astrotomic\OpenGraph\StructuredProperties\Image;
4-
use Astrotomic\OpenGraph\Type;
5-
use Astrotomic\OpenGraph\Types\Article;
6-
use Astrotomic\OpenGraph\Types\Book;
73
use Astrotomic\OpenGraph\Types\Music\Album;
84
use Astrotomic\OpenGraph\Types\Music\Playlist;
95
use Astrotomic\OpenGraph\Types\Music\RadioStation;
106
use Astrotomic\OpenGraph\Types\Music\Song;
11-
use Astrotomic\OpenGraph\Types\Profile;
12-
use Astrotomic\OpenGraph\Types\Video\Episode;
13-
use Astrotomic\OpenGraph\Types\Video\Movie;
14-
use Astrotomic\OpenGraph\Types\Video\Other;
15-
use Astrotomic\OpenGraph\Types\Video\TvShow;
16-
use Astrotomic\OpenGraph\Types\Website;
177

188
it('can generate song tags', function () {
199
$og = Song::make('Title | Example')
@@ -27,10 +17,9 @@
2717

2818
->duration(60 * 1.5)
2919
->musician('http://www.example.com/musician')
30-
->album('http://www.example.com/album', 1, 4)
31-
;
20+
->album('http://www.example.com/album', 1, 4);
3221

33-
assertMatchesHtmlSnapshot((string)$og);
22+
assertMatchesHtmlSnapshot((string) $og);
3423
})->group('music');
3524

3625
it('can generate album tags', function () {
@@ -47,10 +36,9 @@
4736
->song('http://www.example.com/song2', 1, 2)
4837
->song('http://www.example.com/song3', 1, 3)
4938
->song('http://www.example.com/song4', 1, 4)
50-
->releasedAt(new DateTime('2020-06-05'))
51-
;
39+
->releasedAt(new DateTime('2020-06-05'));
5240

53-
assertMatchesHtmlSnapshot((string)$og);
41+
assertMatchesHtmlSnapshot((string) $og);
5442
})->group('music');
5543

5644
it('can generate playlist tags', function () {
@@ -66,10 +54,9 @@
6654
->song('http://www.example.com/song1', 1, 1)
6755
->song('http://www.example.com/song2', 1, 2)
6856
->song('http://www.example.com/song3', 1, 3)
69-
->song('http://www.example.com/song4', 1, 4)
70-
;
57+
->song('http://www.example.com/song4', 1, 4);
7158

72-
assertMatchesHtmlSnapshot((string)$og);
59+
assertMatchesHtmlSnapshot((string) $og);
7360
})->group('music');
7461

7562
it('can generate radiostation tags', function () {
@@ -81,8 +68,7 @@
8168
->siteName('Example')
8269
->image('http://www.example.com/image1.jpg')
8370

84-
->creator('http://www.example.com/creator')
85-
;
71+
->creator('http://www.example.com/creator');
8672

87-
assertMatchesHtmlSnapshot((string)$og);
73+
assertMatchesHtmlSnapshot((string) $og);
8874
})->group('music');

tests/VideoTypesTest.php

+8-17
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
<?php
22

33
use Astrotomic\OpenGraph\StructuredProperties\Image;
4-
use Astrotomic\OpenGraph\Type;
5-
use Astrotomic\OpenGraph\Types\Article;
6-
use Astrotomic\OpenGraph\Types\Book;
7-
use Astrotomic\OpenGraph\Types\Profile;
84
use Astrotomic\OpenGraph\Types\Video\Episode;
95
use Astrotomic\OpenGraph\Types\Video\Movie;
106
use Astrotomic\OpenGraph\Types\Video\Other;
117
use Astrotomic\OpenGraph\Types\Video\TvShow;
12-
use Astrotomic\OpenGraph\Types\Website;
138

149
it('can generate movie tags', function () {
1510
$og = Movie::make('Title | Example')
@@ -34,10 +29,9 @@
3429
->writer('http://www.example.com/writer')
3530
->duration(60 * 90)
3631
->tag('Crime')
37-
->tag('Thriller')
38-
;
32+
->tag('Thriller');
3933

40-
assertMatchesHtmlSnapshot((string)$og);
34+
assertMatchesHtmlSnapshot((string) $og);
4135
})->group('video');
4236

4337
it('can generate tv show tags', function () {
@@ -53,10 +47,9 @@
5347
->actor('http://www.example.com/actor', 'role')
5448
->director('http://www.example.com/director')
5549
->writer('http://www.example.com/writer')
56-
->tag('Crime')
57-
;
50+
->tag('Crime');
5851

59-
assertMatchesHtmlSnapshot((string)$og);
52+
assertMatchesHtmlSnapshot((string) $og);
6053
})->group('video');
6154

6255
it('can generate episode tags', function () {
@@ -74,10 +67,9 @@
7467
->actor('http://www.example.com/actor', 'role')
7568
->director('http://www.example.com/director')
7669
->writer('http://www.example.com/writer')
77-
->tag('Crime')
78-
;
70+
->tag('Crime');
7971

80-
assertMatchesHtmlSnapshot((string)$og);
72+
assertMatchesHtmlSnapshot((string) $og);
8173
})->group('video');
8274

8375
it('can generate other tags', function () {
@@ -95,8 +87,7 @@
9587
->actor('http://www.example.com/actor', 'role')
9688
->director('http://www.example.com/director')
9789
->writer('http://www.example.com/writer')
98-
->tag('Crime')
99-
;
90+
->tag('Crime');
10091

101-
assertMatchesHtmlSnapshot((string)$og);
92+
assertMatchesHtmlSnapshot((string) $og);
10293
})->group('video');

0 commit comments

Comments
 (0)