Passed
Push — master ( 3eedbe...821bb4 )
by Sergey
57s queued 21s
created
tests/Unit/ConnectionTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
tests/Integration/Models/ContactPerson/CrudTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Connection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
tests/Integration/Models/Counterparty/SavePrivatePersonTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
tests/Integration/Models/InternetDocument/CrudTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             }
125 125
             $attemptsNotExceeded = $attempt <= 3;
126 126
             if ($attemptsNotExceeded) {
127
-                printf(PHP_EOL . 'Attempt %d to delete document failed.' . PHP_EOL, $attempt);
127
+                printf(PHP_EOL.'Attempt %d to delete document failed.'.PHP_EOL, $attempt);
128 128
                 sleep(5 * $attempt);
129 129
                 $this->deleteDocument($ref, ++$attempt);
130 130
             } else {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      */
182 182
     private function gulp(): void
183 183
     {
184
-        $gulp = (int)getenv('GULP');
184
+        $gulp = (int) getenv('GULP');
185 185
 
186 186
         if ($gulp) {
187 187
             sleep($gulp);
Please login to merge, or discard this patch.
src/Models/Address.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
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
         ]);
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
     public function getCities(int $page = 1, int $limit = PHP_INT_MAX, string $search = ''): array
154 154
     {
155 155
         $params = array_filter([
156
-            'Page' => (string)$page,
157
-            'Limit' => (string)$limit,
156
+            'Page' => (string) $page,
157
+            'Limit' => (string) $limit,
158 158
             'FindByString' => $search,
159 159
         ]);
160 160
         return $this->connection->post(self::MODEL_NAME, 'getCities', $params);
Please login to merge, or discard this patch.
tests/Integration/Models/Common/GetBackwardDeliveryCargoTypesTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     private function gulp(): void
44 44
     {
45
-        $gulp = (int)getenv('GULP');
45
+        $gulp = (int) getenv('GULP');
46 46
 
47 47
         if ($gulp) {
48 48
             sleep($gulp);
Please login to merge, or discard this patch.