From fea77573287831aaa26edbbbbd45c73446cdfa7d Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Thu, 27 Jan 2022 17:58:36 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/CastsEnums.php | 4 +++- src/Commands/EnumMakeCommand.php | 2 ++ src/EnumServiceProvider.php | 2 ++ src/EnumsAreCompatibleWithLaravelForms.php | 2 ++ tests/AAASmokeTest.php | 4 +++- tests/DynamicClassResolverTest.php | 8 +++++--- tests/EnumAccessorTest.php | 14 ++++++++------ tests/EnumMutatorTest.php | 4 +++- tests/EnumToArrayTest.php | 6 ++++-- tests/Models/Address.php | 4 +++- tests/Models/AddressStatus.php | 8 +++++--- tests/Models/AddressStatusResolver.php | 2 ++ tests/Models/AddressType.php | 6 ++++-- tests/Models/Client.php | 2 ++ tests/Models/Eloquent.php | 2 ++ tests/Models/EloquentType.php | 8 +++++--- tests/Models/EloquentTypeProxy.php | 2 ++ tests/Models/Extended/Address.php | 2 ++ tests/Models/Order.php | 2 ++ tests/Models/OrderStatus.php | 12 +++++++----- tests/Models/OrderStatusV2.php | 12 +++++++----- tests/Models/OrderStatusVX.php | 14 ++++++++------ tests/Models/OrderV2.php | 2 ++ tests/Models/OrderVX.php | 2 ++ tests/Resolvers/AddressTypeResolver.php | 2 ++ tests/TestCase.php | 4 +++- 26 files changed, 92 insertions(+), 40 deletions(-) diff --git a/src/CastsEnums.php b/src/CastsEnums.php index 42ddcbc..2765032 100644 --- a/src/CastsEnums.php +++ b/src/CastsEnums.php @@ -1,4 +1,6 @@ enums[$key]; if (strpos($result, '@')) { - $class = Str::before($result, '@'); + $class = Str::before($result, '@'); $method = Str::after($result, '@'); // If no namespace was set, prepend the Model's namespace to the diff --git a/src/Commands/EnumMakeCommand.php b/src/Commands/EnumMakeCommand.php index 309f19a..aac7c2e 100644 --- a/src/Commands/EnumMakeCommand.php +++ b/src/Commands/EnumMakeCommand.php @@ -1,5 +1,7 @@ AddressType::SHIPPING, + 'type' => AddressType::SHIPPING, 'address' => 'Richard Avenue 33' ]); @@ -39,7 +41,7 @@ public function it_resolves_fqcn_enum_class_name_from_the_at_notation() public function it_resolves_local_enum_class_name_from_the_at_notation() { $address = Address::create([ - 'type' => AddressType::SHIPPING, + 'type' => AddressType::SHIPPING, 'address' => 'Richard Avenue 33' ]); @@ -62,7 +64,7 @@ public function at_notation_does_not_collide_if_class_name_is_in_nampespace() public function it_keeps_original_namespace_with_at_notation_when_using_short_classnames_in_extended_classes() { $address = ExtendedAddress::create([ - 'type' => AddressType::BILLING, + 'type' => AddressType::BILLING, 'address' => 'Alexander Platz 1.' ]); diff --git a/tests/EnumAccessorTest.php b/tests/EnumAccessorTest.php index e6f4964..c6ff479 100644 --- a/tests/EnumAccessorTest.php +++ b/tests/EnumAccessorTest.php @@ -1,4 +1,6 @@ 'KH8FRWAD', - 'status' => OrderStatus::PROCESSING, + 'number' => 'KH8FRWAD', + 'status' => OrderStatus::PROCESSING, 'is_active' => 1 ]); @@ -129,8 +131,8 @@ public function it_doesnt_break_related_properties() $client = Client::create(['name' => 'Britney Spears']); $order = Order::create([ - 'number' => 'LDYG4G4', - 'status' => OrderStatus::PROCESSING, + 'number' => 'LDYG4G4', + 'status' => OrderStatus::PROCESSING, 'client_id' => $client->id ]); diff --git a/tests/EnumMutatorTest.php b/tests/EnumMutatorTest.php index 9fa2327..cc75fc4 100644 --- a/tests/EnumMutatorTest.php +++ b/tests/EnumMutatorTest.php @@ -1,4 +1,6 @@ expectException(\UnexpectedValueException::class); - $order = new Order(); + $order = new Order(); $order->status = 'wtf'; } } diff --git a/tests/EnumToArrayTest.php b/tests/EnumToArrayTest.php index 9dce1ca..8f20af7 100644 --- a/tests/EnumToArrayTest.php +++ b/tests/EnumToArrayTest.php @@ -1,4 +1,6 @@ attributesToArray(); - $array = $order->toArray(); + $array = $order->toArray(); $this->assertEquals($array, $attributesArray); } diff --git a/tests/Models/Address.php b/tests/Models/Address.php index dd60170..39a8578 100644 --- a/tests/Models/Address.php +++ b/tests/Models/Address.php @@ -1,4 +1,6 @@ 'Konekt\\Enum\\Eloquent\\Tests\\Resolvers\\AddressTypeResolver@enumClass', + 'type' => 'Konekt\\Enum\\Eloquent\\Tests\\Resolvers\\AddressTypeResolver@enumClass', 'status' => 'AddressStatusResolver@enumClass' ]; } diff --git a/tests/Models/AddressStatus.php b/tests/Models/AddressStatus.php index a13d1da..4684e42 100644 --- a/tests/Models/AddressStatus.php +++ b/tests/Models/AddressStatus.php @@ -1,4 +1,6 @@ capsule = new Capsule(); $this->capsule->addConnection([ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => ':memory:', ]);