@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | class ConnectionTest extends TestCase |
23 | 23 | { |
24 | 24 | private Connection $object; |
25 | - private Client|MockObject $clientMock; |
|
25 | + private Client | MockObject $clientMock; |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @throws Exception |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @return ResponseInterface|MockObject |
93 | 93 | * @throws Exception |
94 | 94 | */ |
95 | - private function createResponse(string $content): ResponseInterface|MockObject |
|
95 | + private function createResponse(string $content): ResponseInterface | MockObject |
|
96 | 96 | { |
97 | 97 | $response = $this->createMock(ResponseInterface::class); |
98 | 98 | $response->method('getStatusCode')->willReturn(200); |
@@ -135,7 +135,7 @@ |
||
135 | 135 | 'Ref' => $filters['Ref'] ?? null, |
136 | 136 | 'RegionRef' => $filters['RegionRef'] ?? null, |
137 | 137 | 'FindByString' => $filters['FindByString'] ?? null, |
138 | - 'Warehouse' => (int)$warehouse, |
|
138 | + 'Warehouse' => (int) $warehouse, |
|
139 | 139 | 'Page' => $page, |
140 | 140 | 'Limit' => $limit, |
141 | 141 | ]); |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | { |
35 | 35 | $sfx = $this->randomString(5); |
36 | 36 | $counterparty = [ |
37 | - 'FirstName' => 'Іван' . $sfx, |
|
38 | - 'MiddleName' => 'Іванович' . $sfx, |
|
39 | - 'LastName' => 'Іванов' . $sfx, |
|
37 | + 'FirstName' => 'Іван'.$sfx, |
|
38 | + 'MiddleName' => 'Іванович'.$sfx, |
|
39 | + 'LastName' => 'Іванов'.$sfx, |
|
40 | 40 | 'Phone' => rand(380000000000, 380000999999), |
41 | 41 | 'Email' => '[email protected]', |
42 | 42 | 'CounterpartyProperty' => 'Recipient', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | //update counterparty |
50 | 50 | $counterparty['Ref'] = $actualResult['Ref']; |
51 | - $counterparty['MiddleName'] = 'Петрович' . $sfx; |
|
51 | + $counterparty['MiddleName'] = 'Петрович'.$sfx; |
|
52 | 52 | $counterparty['CityRef'] = self::CITY_REF; |
53 | 53 | |
54 | 54 | $actualResult = $this->model->updatePrivatePerson($counterparty); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | { |
42 | 42 | $sfx = $this->randomString(5); |
43 | 43 | $counterparty = $this->counterpartyModel->savePrivatePerson([ |
44 | - 'FirstName' => 'Іван' . $sfx, |
|
45 | - 'MiddleName' => 'Іванович' . $sfx, |
|
46 | - 'LastName' => 'Іванов' . $sfx, |
|
47 | - 'Email' => 'ivan.ivanov.' . substr(uniqid(), 0, 5) . '@nova.poshta.test', |
|
44 | + 'FirstName' => 'Іван'.$sfx, |
|
45 | + 'MiddleName' => 'Іванович'.$sfx, |
|
46 | + 'LastName' => 'Іванов'.$sfx, |
|
47 | + 'Email' => 'ivan.ivanov.'.substr(uniqid(), 0, 5).'@nova.poshta.test', |
|
48 | 48 | 'Phone' => rand(380000000000, 380000999999), |
49 | 49 | 'CounterpartyProperty' => 'Recipient', |
50 | 50 | ]); |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | |
55 | 55 | //create counterparty |
56 | 56 | $contactPersonData = [ |
57 | - 'FirstName' => 'Петро' . $sfx, |
|
58 | - 'MiddleName' => 'Петрович' . $sfx, |
|
59 | - 'LastName' => 'Петров' . $sfx, |
|
60 | - 'Email' => 'petro.petrov.' . substr(uniqid(), 0, 5) . '@nova.poshta.test', |
|
57 | + 'FirstName' => 'Петро'.$sfx, |
|
58 | + 'MiddleName' => 'Петрович'.$sfx, |
|
59 | + 'LastName' => 'Петров'.$sfx, |
|
60 | + 'Email' => 'petro.petrov.'.substr(uniqid(), 0, 5).'@nova.poshta.test', |
|
61 | 61 | 'Phone' => rand(380000000000, 380000999999), |
62 | 62 | ]; |
63 | 63 | $contactPerson = $this->model->save($counterparty['Ref'], $contactPersonData); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | //update contact person |
68 | 68 | $contactPersonData['Ref'] = $contactPerson['Ref']; |
69 | - $contactPersonData['MiddleName'] = 'Сидорович' . $sfx; |
|
69 | + $contactPersonData['MiddleName'] = 'Сидорович'.$sfx; |
|
70 | 70 | $contactPersonUpdated = $this->model->update($counterparty['Ref'], $contactPersonData); |
71 | 71 | $this->assertContactPerson($counterparty, $contactPersonUpdated, ['Ref', 'MiddleName', 'Email']); |
72 | 72 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $result = $this->counterpartyModel->getCounterpartyContactPersons($ref, $page++); |
113 | 113 | foreach ($result as $contactPerson) { |
114 | 114 | if ($this->ensureContactPerson($contactPerson, ['Ref' => $ref], ['Ref'])) { |
115 | - $this->fail('Assert failed that counterparty `' . $ref . '` has been deleted'); |
|
115 | + $this->fail('Assert failed that counterparty `'.$ref.'` has been deleted'); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } while (count($result) > 0); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $result = $this->counterpartyModel->getCounterpartyContactPersons($counterparty['Ref']); |
162 | 162 | foreach ($result as $contactPerson) { |
163 | 163 | $this->model->delete($contactPerson['Ref']); |
164 | - $template = 'Contact person %s %s has been deleted' . PHP_EOL; |
|
164 | + $template = 'Contact person %s %s has been deleted'.PHP_EOL; |
|
165 | 165 | echo sprintf($template, $contactPerson['FirstName'], $contactPerson['LastName']); |
166 | 166 | } |
167 | 167 | } while (count($result) > 0); |
@@ -63,7 +63,7 @@ |
||
63 | 63 | if ($body['success'] === false) { |
64 | 64 | $error = $body['errors'][0] ?? $body['warnings'][0] ?? 'Unknown error'; |
65 | 65 | $errorCode = $body['errorCodes'][0] ?? $body['warningCodes'][0] ?? 0; |
66 | - throw new NovaPoshtaApiException(sprintf(self::ERROR_MSG_TEMPLATE, $error), (int)$errorCode); |
|
66 | + throw new NovaPoshtaApiException(sprintf(self::ERROR_MSG_TEMPLATE, $error), (int) $errorCode); |
|
67 | 67 | } |
68 | 68 | return $body['data']; |
69 | 69 | } catch (GuzzleException $e) { |