Skip to content

Commit

Permalink
Merge pull request #5 from spatie/analysis-qJvYla
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rubenvanassche authored Nov 21, 2019
2 parents fcfcf4b + ad5959b commit b0f2f1e
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/ComponentPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/Components/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Builders/ComponentBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/Builders/PropertyBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ComponentPayloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/AlertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Components/CalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/ComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/Components/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -112,7 +113,7 @@ public function it_can_set_the_coordinates()

$this->assertPropertyEqualsInPayload('GEO', [
'lat' => 51.2343,
'lng' => 4.4287
'lng' => 4.4287,
], $payload);
}

Expand All @@ -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);

}
}
2 changes: 1 addition & 1 deletion tests/PropertyTypes/CoordinatesPropertyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
2 changes: 1 addition & 1 deletion tests/PropertyTypes/DateTimePropertyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PropertyTypes/DurationPropertyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PropertyTypes/PropertyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PropertyTypes/TextPropertyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit b0f2f1e

Please sign in to comment.