@@ -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 | ]); |
@@ -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) { |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $sfx = $this->randomString(5); |
| 35 | 35 | $counterparty = [ |
| 36 | - 'FirstName' => 'Іван' . $sfx, |
|
| 37 | - 'MiddleName' => 'Іванович' . $sfx, |
|
| 38 | - 'LastName' => 'Іванов' . $sfx, |
|
| 36 | + 'FirstName' => 'Іван'.$sfx, |
|
| 37 | + 'MiddleName' => 'Іванович'.$sfx, |
|
| 38 | + 'LastName' => 'Іванов'.$sfx, |
|
| 39 | 39 | 'Phone' => rand(380000000000, 380000999999), |
| 40 | 40 | 'Email' => '[email protected]', |
| 41 | 41 | 'CounterpartyProperty' => 'Recipient', |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | //update counterparty |
| 49 | 49 | $counterparty['Ref'] = $actualResult['Ref']; |
| 50 | - $counterparty['MiddleName'] = 'Петрович' . $sfx; |
|
| 50 | + $counterparty['MiddleName'] = 'Петрович'.$sfx; |
|
| 51 | 51 | $counterparty['CityRef'] = self::CITY_REF_KHARKIV; |
| 52 | 52 | |
| 53 | 53 | $actualResult = $this->model->updatePrivatePerson($counterparty); |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | } |
| 141 | 141 | $attemptsNotExceeded = $attempt <= 3; |
| 142 | 142 | if ($attemptsNotExceeded) { |
| 143 | - printf(PHP_EOL . 'Attempt %d to delete document failed.' . PHP_EOL, $attempt); |
|
| 143 | + printf(PHP_EOL.'Attempt %d to delete document failed.'.PHP_EOL, $attempt); |
|
| 144 | 144 | sleep(5 * $attempt); |
| 145 | 145 | $this->deleteDocument($ref, ++$attempt); |
| 146 | 146 | } else { |