From 58645c250565fb9b4fd5018865818995f7392579 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Thu, 28 Sep 2017 09:41:58 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Generators/IcsGenerator.php | 16 ++++++++-------- src/Link.php | 2 +- ...torTest__it_can_generate_a_google_link__1.php | 4 +++- ...ratorTest__it_can_generate_an_ics_link__1.php | 4 +++- ...atorTest__it_can_generate_a_yahoo_link__1.php | 4 +++- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Generators/IcsGenerator.php b/src/Generators/IcsGenerator.php index 5de4638..5e2f8f8 100644 --- a/src/Generators/IcsGenerator.php +++ b/src/Generators/IcsGenerator.php @@ -11,11 +11,11 @@ public function generate(Link $link): string { $url = 'data:text/calendar;charset=utf8,'; - $url .= "BEGIN:VCALENDAR%0A"; - $url .= "VERSION:2.0%0A"; - $url .= "BEGIN:VEVENT%0A"; - $url .= "DTSTART:".$link->from->format('Ymd\THis')."%0A"; - $url .= "DTEND:".$link->to->format('Ymd\THis')."%0A"; + $url .= 'BEGIN:VCALENDAR%0A'; + $url .= 'VERSION:2.0%0A'; + $url .= 'BEGIN:VEVENT%0A'; + $url .= 'DTSTART:'.$link->from->format('Ymd\THis').'%0A'; + $url .= 'DTEND:'.$link->to->format('Ymd\THis').'%0A'; $url .= "SUMMARY:{$link->title}%0A"; if ($link->description) { @@ -23,11 +23,11 @@ public function generate(Link $link): string } if ($link->address) { - $url .= "LOCATION:".str_replace(',', '', $link->address)."%0A"; + $url .= 'LOCATION:'.str_replace(',', '', $link->address).'%0A'; } - $url .= "END:VEVENT%0A"; - $url .= "END:VCALENDAR"; + $url .= 'END:VEVENT%0A'; + $url .= 'END:VCALENDAR'; return $url; } diff --git a/src/Link.php b/src/Link.php index d5ffbd9..f713644 100644 --- a/src/Link.php +++ b/src/Link.php @@ -4,9 +4,9 @@ use DateTime; use Spatie\CalendarLinks\Exceptions\InvalidLink; -use Spatie\CalendarLinks\Generators\GoogleGenerator; use Spatie\CalendarLinks\Generators\IcsGenerator; use Spatie\CalendarLinks\Generators\YahooGenerator; +use Spatie\CalendarLinks\Generators\GoogleGenerator; /** * @property string $title diff --git a/tests/Generators/__snapshots__/GoogleGeneratorTest__it_can_generate_a_google_link__1.php b/tests/Generators/__snapshots__/GoogleGeneratorTest__it_can_generate_a_google_link__1.php index 2971a97..e973daa 100644 --- a/tests/Generators/__snapshots__/GoogleGeneratorTest__it_can_generate_a_google_link__1.php +++ b/tests/Generators/__snapshots__/GoogleGeneratorTest__it_can_generate_a_google_link__1.php @@ -1 +1,3 @@ -