From b8d4440d4baed682f5eb86d59f1c4110a2bd3a16 Mon Sep 17 00:00:00 2001 From: Markus Thielen Date: Tue, 2 Apr 2024 16:51:06 +0200 Subject: [PATCH] away with you tabs --- .php-cs-fixer.php | 2 +- src/CXml/Model/Classification.php | 16 +- src/CXml/Model/Contact.php | 8 +- src/CXml/Model/Message/QuoteMessage.php | 22 +- src/CXml/Model/Message/QuoteMessageHeader.php | 104 +++---- tests/CXmlTest/Model/SerializerTest.php | 288 +++++++++--------- 6 files changed, 220 insertions(+), 220 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index fee3af0..be19d30 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -20,7 +20,7 @@ 'scope' => 'namespaced', 'strict' => false, ], - 'nullable_type_declaration_for_default_null_value' => false, + 'nullable_type_declaration_for_default_null_value' => false, 'void_return' => true, 'random_api_migration' => true, 'pow_to_exponentiation' => true, diff --git a/src/CXml/Model/Classification.php b/src/CXml/Model/Classification.php index 6dd2092..b6c796a 100644 --- a/src/CXml/Model/Classification.php +++ b/src/CXml/Model/Classification.php @@ -22,13 +22,13 @@ public function __construct(string $domain, string $value) $this->value = $value; } - public function getDomain(): string - { - return $this->domain; - } + public function getDomain(): string + { + return $this->domain; + } - public function getValue(): string - { - return $this->value; - } + public function getValue(): string + { + return $this->value; + } } diff --git a/src/CXml/Model/Contact.php b/src/CXml/Model/Contact.php index 11f78c1..2df171d 100644 --- a/src/CXml/Model/Contact.php +++ b/src/CXml/Model/Contact.php @@ -69,8 +69,8 @@ public function addEmail(string $email): self return $this; } - public function getEmail(): ?string - { - return $this->email; - } + public function getEmail(): ?string + { + return $this->email; + } } diff --git a/src/CXml/Model/Message/QuoteMessage.php b/src/CXml/Model/Message/QuoteMessage.php index ae8c41a..6ea84d7 100644 --- a/src/CXml/Model/Message/QuoteMessage.php +++ b/src/CXml/Model/Message/QuoteMessage.php @@ -14,13 +14,13 @@ class QuoteMessage implements MessagePayloadInterface */ private QuoteMessageHeader $quoteMessageHeader; - /** - * @Ser\XmlList(inline=true, entry="QuoteItemIn") - * @Ser\Type("array") - * - * @var ItemIn[] - */ - private array $quoteMessageItems = []; + /** + * @Ser\XmlList(inline=true, entry="QuoteItemIn") + * @Ser\Type("array") + * + * @var ItemIn[] + */ + private array $quoteMessageItems = []; private function __construct(QuoteMessageHeader $quoteMessageHeader) { @@ -39,8 +39,8 @@ public function getQuoteMessageHeader(): QuoteMessageHeader return $this->quoteMessageHeader; } - public function getQuoteMessageItems(): array - { - return $this->quoteMessageItems; - } + public function getQuoteMessageItems(): array + { + return $this->quoteMessageItems; + } } diff --git a/src/CXml/Model/Message/QuoteMessageHeader.php b/src/CXml/Model/Message/QuoteMessageHeader.php index 8fb48e1..78ac5c8 100644 --- a/src/CXml/Model/Message/QuoteMessageHeader.php +++ b/src/CXml/Model/Message/QuoteMessageHeader.php @@ -68,11 +68,11 @@ class QuoteMessageHeader private ShipTo $shipTo; /** - * @Ser\XmlList(inline=true, entry="Contact") - * @Ser\Type("array") - * - * @var Contact[] - */ + * @Ser\XmlList(inline=true, entry="Contact") + * @Ser\Type("array") + * + * @var Contact[] + */ private array $contacts = []; public function __construct(OrganizationId $organizationId, MoneyWrapper $total, string $type, string $quoteId, \DateTime $quoteDate, string $currency, string $lang = 'en') @@ -108,51 +108,51 @@ public function addContact(Contact $contact): self return $this; } - public function getOrganizationId(): OrganizationId - { - return $this->organizationId; - } - - /** - * @return Contact[] - */ - public function getContacts(): array - { - return $this->contacts; - } - - public function getCurrency(): string - { - return $this->currency; - } - - public function getQuoteId(): string - { - return $this->quoteId; - } - - public function getQuoteDate(): \DateTimeInterface - { - return $this->quoteDate; - } - - public function getLang(): string - { - return $this->lang; - } - - public function getTotal(): MoneyWrapper - { - return $this->total; - } - - public function getType(): string - { - return $this->type; - } - - public function getShipTo(): ShipTo - { - return $this->shipTo; - } + public function getOrganizationId(): OrganizationId + { + return $this->organizationId; + } + + /** + * @return Contact[] + */ + public function getContacts(): array + { + return $this->contacts; + } + + public function getCurrency(): string + { + return $this->currency; + } + + public function getQuoteId(): string + { + return $this->quoteId; + } + + public function getQuoteDate(): \DateTimeInterface + { + return $this->quoteDate; + } + + public function getLang(): string + { + return $this->lang; + } + + public function getTotal(): MoneyWrapper + { + return $this->total; + } + + public function getType(): string + { + return $this->type; + } + + public function getShipTo(): ShipTo + { + return $this->shipTo; + } } diff --git a/tests/CXmlTest/Model/SerializerTest.php b/tests/CXmlTest/Model/SerializerTest.php index ea3e77d..767f1b0 100644 --- a/tests/CXmlTest/Model/SerializerTest.php +++ b/tests/CXmlTest/Model/SerializerTest.php @@ -64,38 +64,38 @@ public function testSerializeSimpleRequest(): void // XML copied from cXML Reference Guide $expectedXml = ' - -
- - - admin@acme.com - - - - - 012345678 - - - - - sysadmin@buyer.com - abracadabra - - Network Hub 1.1 - -
- - - nomnom - - https://browserFormPost - - - https://supplierSetup - - - -
'; + +
+ + + admin@acme.com + + + + + 012345678 + + + + + sysadmin@buyer.com + abracadabra + + Network Hub 1.1 + +
+ + + nomnom + + https://browserFormPost + + + https://supplierSetup + + + +
'; $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -136,37 +136,37 @@ public function testSerializeSimpleMessage(): void // XML *NOT* copied from cXML Reference Guide $expectedXml = ' - -
- - - admin@acme.com - - - - - 012345678 - - - - - sysadmin@buyer.com - abracadabra - - Network Hub 1.1 - -
- - - 34234234ADFSDF234234 - - - 763.20 - - - - -
'; + +
+ + + admin@acme.com + + + + + 012345678 + + + + + sysadmin@buyer.com + abracadabra + + Network Hub 1.1 + +
+ + + 34234234ADFSDF234234 + + + 763.20 + + + + +
'; $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -189,11 +189,11 @@ public function testSerializeSimpleResponse(): void // XML copied from cXML Reference Guide $expectedXml = ' - - - Ping Response CXml - - '; + + + Ping Response CXml + + '; $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -202,11 +202,11 @@ public function testDeserialize(): void { $xml = ' - - - Ping Response CXml - - '; + + + Ping Response CXml + + '; $serializer = Serializer::create(); $cXml = $serializer->deserialize($xml); @@ -224,11 +224,11 @@ public function testDeserializeWithMilliseconds(): void { $xmlIn = ' - - - Ping Response CXml - - '; + + + Ping Response CXml + + '; $serializer = Serializer::create(); $cXml = $serializer->deserialize($xmlIn); @@ -237,11 +237,11 @@ public function testDeserializeWithMilliseconds(): void $xmlOut = ' - - - Ping Response CXml - - '; + + + Ping Response CXml + + '; $this->assertXmlStringEqualsXmlString($xmlOut, $actual); } @@ -249,21 +249,21 @@ public function testDeserializeWithDateTimeForDate(): void { $xmlIn = ' - - -
-
- - - - - - - - - - -
'; + + +
+
+ + + + + + + + + + +
'; $serializer = Serializer::create(); $cXml = $serializer->deserialize($xmlIn); @@ -286,17 +286,17 @@ public function testDeserializeInvalidDate(): void $xmlIn = ' - - -
-
- - - - - - -
'; + + +
+
+ + + + + + +
'; $serializer = Serializer::create(); $serializer->deserialize($xmlIn); @@ -341,41 +341,41 @@ public function testSerializeDateOnly(): void $expectedXml = ' - -
- - - admin@acme.com - - - - - 012345678 - - - - - sysadmin@buyer.com - abracadabra - - Network Hub 1.1 - -
- - - - - 0.00 - - -
- name -
-
-
-
-
-
'; + +
+ + + admin@acme.com + + + + + 012345678 + + + + + sysadmin@buyer.com + abracadabra + + Network Hub 1.1 + +
+ + + + + 0.00 + + +
+ name +
+
+
+
+
+
'; $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); }