From a1a9d4f04371f398e6472dcfb50ce9288c004948 Mon Sep 17 00:00:00 2001 From: rubenvanassche Date: Mon, 26 Jul 2021 09:48:49 +0000 Subject: [PATCH] Fix styling --- src/Casts/CarbonCast.php | 1 - src/Casts/CarbonImmutableCast.php | 2 -- src/Casts/DateTimeImmutableCast.php | 1 - tests/DataTest.php | 4 ++-- .../TypeScriptTransformer/DataTypeScriptTransformerTest.php | 2 +- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Casts/CarbonCast.php b/src/Casts/CarbonCast.php index 0602443e..56e3bb88 100644 --- a/src/Casts/CarbonCast.php +++ b/src/Casts/CarbonCast.php @@ -3,7 +3,6 @@ namespace Spatie\LaravelData\Casts; use Carbon\Carbon; -use DateTime; use Spatie\LaravelData\Support\DataProperty; class CarbonCast extends DateTimeInterfaceCast diff --git a/src/Casts/CarbonImmutableCast.php b/src/Casts/CarbonImmutableCast.php index 70005c14..e2dc675f 100644 --- a/src/Casts/CarbonImmutableCast.php +++ b/src/Casts/CarbonImmutableCast.php @@ -2,9 +2,7 @@ namespace Spatie\LaravelData\Casts; -use Carbon\Carbon; use Carbon\CarbonImmutable; -use DateTime; use Spatie\LaravelData\Support\DataProperty; class CarbonImmutableCast extends DateTimeInterfaceCast diff --git a/src/Casts/DateTimeImmutableCast.php b/src/Casts/DateTimeImmutableCast.php index 67d346e9..df30d65a 100644 --- a/src/Casts/DateTimeImmutableCast.php +++ b/src/Casts/DateTimeImmutableCast.php @@ -2,7 +2,6 @@ namespace Spatie\LaravelData\Casts; -use DateTime; use DateTimeImmutable; use Spatie\LaravelData\Support\DataProperty; diff --git a/tests/DataTest.php b/tests/DataTest.php index 77d377b9..34f70d33 100644 --- a/tests/DataTest.php +++ b/tests/DataTest.php @@ -85,7 +85,7 @@ public function __construct( /** @test */ public function it_can_include_a_nested_lazy_property() { - $data = new class(Lazy::create(fn () => LazyData::create('Hello')), Lazy::create(fn () => LazyData::collection([ 'is', 'it', 'me', 'your', 'looking', 'for', ])), ) extends Data { + $data = new class(Lazy::create(fn () => LazyData::create('Hello')), Lazy::create(fn () => LazyData::collection([ 'is', 'it', 'me', 'your', 'looking', 'for', ])),) extends Data { public function __construct( public Lazy | LazyData $data, /** @var \Spatie\LaravelData\Tests\Fakes\LazyData[] */ @@ -330,7 +330,7 @@ public function it_can_dynamically_include_data_based_upon_the_request() /** @test */ public function it_can_get_the_data_object_without_transforming() { - $data = new class($dataObject = new SimpleData('Test'), $dataCollection = SimpleData::collection([ new SimpleData('A'), new SimpleData('B'), ]), Lazy::create(fn () => new SimpleData('Lazy')), 'Test', $transformable = new DateTime('16 may 1994'), ) extends Data { + $data = new class($dataObject = new SimpleData('Test'), $dataCollection = SimpleData::collection([ new SimpleData('A'), new SimpleData('B'), ]), Lazy::create(fn () => new SimpleData('Lazy')), 'Test', $transformable = new DateTime('16 may 1994'),) extends Data { public function __construct( public SimpleData $data, public DataCollection $dataCollection, diff --git a/tests/Support/TypeScriptTransformer/DataTypeScriptTransformerTest.php b/tests/Support/TypeScriptTransformer/DataTypeScriptTransformerTest.php index cf2b4ac8..a064f47c 100644 --- a/tests/Support/TypeScriptTransformer/DataTypeScriptTransformerTest.php +++ b/tests/Support/TypeScriptTransformer/DataTypeScriptTransformerTest.php @@ -18,7 +18,7 @@ public function it_can_covert_a_data_object_to_typescript() { $config = TypeScriptTransformerConfig::create(); - $data = new class(null, 42, true, 'Hello world', 3.14, ['the', 'meaning', 'of', 'life'], Lazy::create(fn () => 'Lazy'), SimpleData::create('Simple data'), SimpleData::collection([]), ) extends Data { + $data = new class(null, 42, true, 'Hello world', 3.14, ['the', 'meaning', 'of', 'life'], Lazy::create(fn () => 'Lazy'), SimpleData::create('Simple data'), SimpleData::collection([]),) extends Data { public function __construct( public null | int $nullable, public int $int,