From ad5959b2ceb0be596b1a985ecca66eda0b9a617e Mon Sep 17 00:00:00 2001 From: Ruben Van Assche Date: Thu, 21 Nov 2019 13:11:14 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/ComponentPayload.php | 4 ++-- src/Components/Alert.php | 2 +- src/Components/Calendar.php | 2 +- src/Components/Component.php | 2 +- src/Components/Event.php | 1 - tests/Builders/ComponentBuilderTest.php | 4 ++-- tests/Builders/PropertyBuilderTest.php | 4 ++-- tests/ComponentPayloadTest.php | 2 +- tests/Components/AlertTest.php | 2 +- tests/Components/CalendarTest.php | 4 ++-- tests/Components/ComponentTest.php | 2 +- tests/Components/EventTest.php | 10 +++++----- tests/PropertyTypes/CoordinatesPropertyTypeTest.php | 2 +- tests/PropertyTypes/DateTimePropertyTypeTest.php | 2 +- tests/PropertyTypes/DurationPropertyTypeTest.php | 2 +- tests/PropertyTypes/PropertyTypeTest.php | 2 +- tests/PropertyTypes/TextPropertyTypeTest.php | 2 +- 17 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/ComponentPayload.php b/src/ComponentPayload.php index 525408d..5d4ede1 100644 --- a/src/ComponentPayload.php +++ b/src/ComponentPayload.php @@ -3,12 +3,12 @@ namespace Spatie\IcalendarGenerator; use Closure; -use Exception; use DateTimeInterface; +use Exception; use Spatie\IcalendarGenerator\Components\Component; +use Spatie\IcalendarGenerator\PropertyTypes\DateTimePropertyType; use Spatie\IcalendarGenerator\PropertyTypes\PropertyType; use Spatie\IcalendarGenerator\PropertyTypes\TextPropertyType; -use Spatie\IcalendarGenerator\PropertyTypes\DateTimePropertyType; final class ComponentPayload { diff --git a/src/Components/Alert.php b/src/Components/Alert.php index 99facd8..fdc3e07 100644 --- a/src/Components/Alert.php +++ b/src/Components/Alert.php @@ -5,8 +5,8 @@ use DateInterval; use DateTimeInterface; use Spatie\IcalendarGenerator\ComponentPayload; -use Spatie\IcalendarGenerator\PropertyTypes\Parameter; use Spatie\IcalendarGenerator\PropertyTypes\DateTimePropertyType; +use Spatie\IcalendarGenerator\PropertyTypes\Parameter; final class Alert extends Component { diff --git a/src/Components/Calendar.php b/src/Components/Calendar.php index 0dfc2bd..4cd9bf1 100644 --- a/src/Components/Calendar.php +++ b/src/Components/Calendar.php @@ -125,7 +125,7 @@ public function getPayload(): ComponentPayload ->textProperty(['DESCRIPTION', 'X-WR-CALDESC'], $this->description) ->subComponent(...$events); - if($this->refreshInterval){ + if ($this->refreshInterval) { $payload ->property( DurationPropertyType::create('REFRESH-INTERVAL', $this->refreshInterval) diff --git a/src/Components/Component.php b/src/Components/Component.php index 070263c..f33aab1 100644 --- a/src/Components/Component.php +++ b/src/Components/Component.php @@ -2,8 +2,8 @@ namespace Spatie\IcalendarGenerator\Components; -use Spatie\IcalendarGenerator\ComponentPayload; use Spatie\IcalendarGenerator\Builders\ComponentBuilder; +use Spatie\IcalendarGenerator\ComponentPayload; use Spatie\IcalendarGenerator\Exceptions\InvalidComponent; abstract class Component diff --git a/src/Components/Event.php b/src/Components/Event.php index 69041ef..e23a59f 100644 --- a/src/Components/Event.php +++ b/src/Components/Event.php @@ -8,7 +8,6 @@ use Spatie\IcalendarGenerator\ComponentPayload; use Spatie\IcalendarGenerator\PropertyTypes\CoordinatesPropertyType; use Spatie\IcalendarGenerator\PropertyTypes\Parameter; -use Spatie\IcalendarGenerator\PropertyTypes\TextPropertyType; final class Event extends Component { diff --git a/tests/Builders/ComponentBuilderTest.php b/tests/Builders/ComponentBuilderTest.php index aedb906..1810716 100644 --- a/tests/Builders/ComponentBuilderTest.php +++ b/tests/Builders/ComponentBuilderTest.php @@ -2,9 +2,9 @@ namespace Spatie\IcalendarGenerator\Tests\Builders; -use Spatie\IcalendarGenerator\Tests\TestCase; -use Spatie\IcalendarGenerator\ComponentPayload; use Spatie\IcalendarGenerator\Builders\ComponentBuilder; +use Spatie\IcalendarGenerator\ComponentPayload; +use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\Tests\TestClasses\DummyComponent; use Spatie\IcalendarGenerator\Tests\TestClasses\DummyPropertyType; diff --git a/tests/Builders/PropertyBuilderTest.php b/tests/Builders/PropertyBuilderTest.php index 96e654d..4aec799 100644 --- a/tests/Builders/PropertyBuilderTest.php +++ b/tests/Builders/PropertyBuilderTest.php @@ -2,10 +2,10 @@ namespace Spatie\IcalendarGenerator\Tests\Builders; -use Spatie\IcalendarGenerator\Tests\TestCase; -use Spatie\IcalendarGenerator\PropertyTypes\Parameter; use Spatie\IcalendarGenerator\Builders\PropertyBuilder; +use Spatie\IcalendarGenerator\PropertyTypes\Parameter; use Spatie\IcalendarGenerator\PropertyTypes\TextPropertyType; +use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\Tests\TestClasses\DummyPropertyType; class PropertyBuilderTest extends TestCase diff --git a/tests/ComponentPayloadTest.php b/tests/ComponentPayloadTest.php index 165014c..6ea5dfc 100644 --- a/tests/ComponentPayloadTest.php +++ b/tests/ComponentPayloadTest.php @@ -5,10 +5,10 @@ use DateTime; use Exception; use Spatie\IcalendarGenerator\ComponentPayload; +use Spatie\IcalendarGenerator\PropertyTypes\DateTimePropertyType; use Spatie\IcalendarGenerator\PropertyTypes\Parameter; use Spatie\IcalendarGenerator\PropertyTypes\TextPropertyType; use Spatie\IcalendarGenerator\Tests\TestClasses\DummyComponent; -use Spatie\IcalendarGenerator\PropertyTypes\DateTimePropertyType; use Spatie\IcalendarGenerator\Tests\TestClasses\DummyPropertyType; class ComponentPayloadTest extends TestCase diff --git a/tests/Components/AlertTest.php b/tests/Components/AlertTest.php index 32563b5..ce8dc69 100644 --- a/tests/Components/AlertTest.php +++ b/tests/Components/AlertTest.php @@ -3,8 +3,8 @@ namespace Spatie\IcalendarGenerator\Tests\Components; use DateTime; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\Components\Alert; +use Spatie\IcalendarGenerator\Tests\TestCase; class AlertTest extends TestCase { diff --git a/tests/Components/CalendarTest.php b/tests/Components/CalendarTest.php index ce7e612..54268a6 100644 --- a/tests/Components/CalendarTest.php +++ b/tests/Components/CalendarTest.php @@ -4,9 +4,9 @@ use DateTime; use DateTimeZone; -use Spatie\IcalendarGenerator\Tests\TestCase; -use Spatie\IcalendarGenerator\Components\Event; use Spatie\IcalendarGenerator\Components\Calendar; +use Spatie\IcalendarGenerator\Components\Event; +use Spatie\IcalendarGenerator\Tests\TestCase; class CalendarTest extends TestCase { diff --git a/tests/Components/ComponentTest.php b/tests/Components/ComponentTest.php index 5f92cd4..cf03fed 100644 --- a/tests/Components/ComponentTest.php +++ b/tests/Components/ComponentTest.php @@ -2,8 +2,8 @@ namespace Spatie\IcalendarGenerator\Tests\Components; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\Exceptions\InvalidComponent; +use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\Tests\TestClasses\DummyComponent; class ComponentTest extends TestCase diff --git a/tests/Components/EventTest.php b/tests/Components/EventTest.php index e462011..d1b95b7 100644 --- a/tests/Components/EventTest.php +++ b/tests/Components/EventTest.php @@ -3,8 +3,8 @@ namespace Spatie\IcalendarGenerator\Tests\Components; use DateTime; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\Components\Event; +use Spatie\IcalendarGenerator\Tests\TestCase; class EventTest extends TestCase { @@ -65,6 +65,7 @@ public function it_can_set_a_period_on_an_event() } // TODO: test this + /** @test */ public function an_event_can_be_a_full_day() { @@ -112,7 +113,7 @@ public function it_can_set_the_coordinates() $this->assertPropertyEqualsInPayload('GEO', [ 'lat' => 51.2343, - 'lng' => 4.4287 + 'lng' => 4.4287, ], $payload); } @@ -129,15 +130,14 @@ public function it_can_generate_an_apple_structured_location() $property = $payload->getProperty('X-APPLE-STRUCTURED-LOCATION'); - $this->assertEquals("51.2343,4.4287", $property->getValue()); + $this->assertEquals('51.2343,4.4287', $property->getValue()); $this->assertEquals([ 'lat' => 51.2343, - 'lng' => 4.4287 + 'lng' => 4.4287, ], $property->getOriginalValue()); $this->assertParameterEqualsInProperty('VALUE', 'URI', $property); $this->assertParameterEqualsInProperty('X-ADDRESS', 'Samberstraat 69D, 2060 Antwerpen, Belgium', $property); $this->assertParameterEqualsInProperty('X-APPLE-RADIUS', 72, $property); $this->assertParameterEqualsInProperty('X-TITLE', 'Spatie HQ', $property); - } } diff --git a/tests/PropertyTypes/CoordinatesPropertyTypeTest.php b/tests/PropertyTypes/CoordinatesPropertyTypeTest.php index c6a6996..de7903c 100644 --- a/tests/PropertyTypes/CoordinatesPropertyTypeTest.php +++ b/tests/PropertyTypes/CoordinatesPropertyTypeTest.php @@ -16,7 +16,7 @@ public function it_can_create_a_coordinates_property_type() $this->assertEquals('10.5,20.5', $propertyType->getValue()); $this->assertEquals([ 'lat' => 10.5, - 'lng' => 20.5 + 'lng' => 20.5, ], $propertyType->getOriginalValue()); } } diff --git a/tests/PropertyTypes/DateTimePropertyTypeTest.php b/tests/PropertyTypes/DateTimePropertyTypeTest.php index 0b951b1..94ba9e7 100644 --- a/tests/PropertyTypes/DateTimePropertyTypeTest.php +++ b/tests/PropertyTypes/DateTimePropertyTypeTest.php @@ -4,8 +4,8 @@ use DateTime; use DateTimeZone; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\PropertyTypes\DateTimePropertyType; +use Spatie\IcalendarGenerator\Tests\TestCase; class DateTimePropertyTypeTest extends TestCase { diff --git a/tests/PropertyTypes/DurationPropertyTypeTest.php b/tests/PropertyTypes/DurationPropertyTypeTest.php index 3b7abfe..7341146 100644 --- a/tests/PropertyTypes/DurationPropertyTypeTest.php +++ b/tests/PropertyTypes/DurationPropertyTypeTest.php @@ -2,8 +2,8 @@ namespace Spatie\IcalendarGenerator\Tests\PropertyTypes; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\PropertyTypes\DurationPropertyType; +use Spatie\IcalendarGenerator\Tests\TestCase; final class DurationPropertyTypeTest extends TestCase { diff --git a/tests/PropertyTypes/PropertyTypeTest.php b/tests/PropertyTypes/PropertyTypeTest.php index 8b28a0d..63a0631 100644 --- a/tests/PropertyTypes/PropertyTypeTest.php +++ b/tests/PropertyTypes/PropertyTypeTest.php @@ -3,9 +3,9 @@ namespace Spatie\IcalendarGenerator\Tests\PropertyTypes; use Exception; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\PropertyTypes\Parameter; use Spatie\IcalendarGenerator\PropertyTypes\TextPropertyType; +use Spatie\IcalendarGenerator\Tests\TestCase; class PropertyTypeTest extends TestCase { diff --git a/tests/PropertyTypes/TextPropertyTypeTest.php b/tests/PropertyTypes/TextPropertyTypeTest.php index dba7dc0..4cab3ba 100644 --- a/tests/PropertyTypes/TextPropertyTypeTest.php +++ b/tests/PropertyTypes/TextPropertyTypeTest.php @@ -2,8 +2,8 @@ namespace Spatie\IcalendarGenerator\Tests\PropertyTypes; -use Spatie\IcalendarGenerator\Tests\TestCase; use Spatie\IcalendarGenerator\PropertyTypes\TextPropertyType; +use Spatie\IcalendarGenerator\Tests\TestCase; class TextPropertyTypeTest extends TestCase {