From 40ebe6778b45e23470f40ed7d1e605b662fdbbd8 Mon Sep 17 00:00:00 2001 From: rubenvanassche Date: Wed, 25 Aug 2021 10:30:44 +0000 Subject: [PATCH] Fix styling --- tests/DataTest.php | 2 +- tests/Factories/DataBlueprintFactory.php | 2 +- tests/Factories/DataMagicMethodFactory.php | 4 ---- tests/RequestDataTest.php | 3 +-- .../TypeScriptTransformer/DataTypeScriptTransformerTest.php | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/DataTest.php b/tests/DataTest.php index d7627ba2..8b74f444 100644 --- a/tests/DataTest.php +++ b/tests/DataTest.php @@ -432,7 +432,7 @@ public function it_can_disable_excluding_data_dynamically_from_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/Factories/DataBlueprintFactory.php b/tests/Factories/DataBlueprintFactory.php index 9b90207f..728182b3 100644 --- a/tests/Factories/DataBlueprintFactory.php +++ b/tests/Factories/DataBlueprintFactory.php @@ -59,7 +59,7 @@ public function toString(): string $class->setExtends(Data::class); $methods = array_map( - fn(DataMagicMethodFactory $factory) => $factory->create(), + fn (DataMagicMethodFactory $factory) => $factory->create(), $this->methods ); diff --git a/tests/Factories/DataMagicMethodFactory.php b/tests/Factories/DataMagicMethodFactory.php index 3c04f657..7c78a3a1 100644 --- a/tests/Factories/DataMagicMethodFactory.php +++ b/tests/Factories/DataMagicMethodFactory.php @@ -4,10 +4,6 @@ use Nette\PhpGenerator\Method; use Nette\PhpGenerator\Parameter; -use Nette\PhpGenerator\PromotedParameter; -use Nette\PhpGenerator\Property; -use Spatie\LaravelData\DataCollection; -use Spatie\LaravelData\Lazy; class DataMagicMethodFactory { diff --git a/tests/RequestDataTest.php b/tests/RequestDataTest.php index 5db20588..3c056ef6 100644 --- a/tests/RequestDataTest.php +++ b/tests/RequestDataTest.php @@ -8,7 +8,6 @@ use Illuminate\Testing\TestResponse; use Illuminate\Validation\ValidationException; use Illuminate\Validation\Validator; -use Spatie\LaravelData\Data; use Spatie\LaravelData\Tests\Factories\DataBlueprintFactory; use Spatie\LaravelData\Tests\Factories\DataMagicMethodFactory; use Spatie\LaravelData\Tests\Factories\DataPropertyBlueprintFactory; @@ -87,7 +86,7 @@ public function it_can_overwrite_validation_attributes() /** @test */ public function it_can_change_the_validator() { - RequestData::$validatorClosure = fn(Validator $validator) => $validator->setRules([]); + RequestData::$validatorClosure = fn (Validator $validator) => $validator->setRules([]); $this->invalidRequest() ->assertOk() diff --git a/tests/Support/TypeScriptTransformer/DataTypeScriptTransformerTest.php b/tests/Support/TypeScriptTransformer/DataTypeScriptTransformerTest.php index ed1d7b25..e4b9e337 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::from('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::from('Simple data'), SimpleData::collection([]), ) extends Data { public function __construct( public null | int $nullable, public int $int,