Test Failed
Push — master ( 78a1a9...6b615f )
by P.R.
02:38
created
src/Endpoint/Endpoint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
       {
127 127
         $list[] = $this->createResourceObject($import);
128 128
       }
129
-    } while ($page<($to ?? $result['page']['total_pages']));
129
+    } while ($page < ($to ?? $result['page']['total_pages']));
130 130
 
131 131
     return $list;
132 132
   }
Please login to merge, or discard this patch.
src/Endpoint/ImportEndpoint.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
   {
30 30
     /** @var Import $resource */
31 31
     $resource = parent::restPost(['imports'],
32
-                                 ['api_key' => $this->client->getApiKey()],
33
-                                 ['title'                   => $title,
32
+                                  ['api_key' => $this->client->getApiKey()],
33
+                                  ['title'                   => $title,
34 34
                                   'company_id'              => $this->client->getCompanyId(),
35 35
                                   'expected_invoices_count' => $expectedInvoiceCount]);
36 36
     if (!is_a($resource, Import::class))
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
   public function fetchPageInfo(): array
108 108
   {
109 109
     return parent::restGetPageInfo(['companies', $this->client->getCompanyId(), 'imports'],
110
-                                   ['api_key' => $this->client->getApiKey()]);
110
+                                    ['api_key' => $this->client->getApiKey()]);
111 111
   }
112 112
 
113 113
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/Endpoint/TicketEndpoint.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     $this->invoiceId = $invoiceId;
34 34
 
35 35
     parent::restPost(['invoices', $invoiceId, 'tickets', 'actions', 'archive'],
36
-                     ['api_key' => $this->client->getApiKey()]);
36
+                      ['api_key' => $this->client->getApiKey()]);
37 37
   }
38 38
 
39 39
   //--------------------------------------------------------------------------------------------------------------------
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     $this->invoiceId = $invoiceId;
50 50
 
51 51
     parent::restPost(['invoices', $invoiceId, 'tickets', 'actions', 'assign_to_support'],
52
-                     ['api_key' => $this->client->getApiKey()]);
52
+                      ['api_key' => $this->client->getApiKey()]);
53 53
   }
54 54
 
55 55
   //--------------------------------------------------------------------------------------------------------------------
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 
70 70
     /** @var Ticket $resource */
71 71
     $resource = parent::restPost(['invoices', $invoiceId, 'tickets'],
72
-                                 ['api_key' => $this->client->getApiKey()],
73
-                                 ['message' => $message]);
72
+                                  ['api_key' => $this->client->getApiKey()],
73
+                                  ['message' => $message]);
74 74
     if (!is_a($resource, Ticket::class))
75 75
     {
76 76
       throw new ClubCollectApiException('Expected an Ticket object, got a %s', get_class($resource));
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
     $this->invoiceId = $invoiceId;
95 95
 
96 96
     return parent::restGetList('tickets',
97
-                               ['invoices', $invoiceId, 'tickets'],
98
-                               ['api_key' => $this->client->getApiKey()]);
97
+                                ['invoices', $invoiceId, 'tickets'],
98
+                                ['api_key' => $this->client->getApiKey()]);
99 99
   }
100 100
 
101 101
   //--------------------------------------------------------------------------------------------------------------------
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
   public function fetchPageInfo(string $status): array
146 146
   {
147 147
     return parent::restGetPageInfo(['companies', $this->client->getCompanyId(), 'tickets', $status],
148
-                                   ['api_key' => $this->client->getApiKey()]);
148
+                                    ['api_key' => $this->client->getApiKey()]);
149 149
   }
150 150
 
151 151
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/ClubCollectApiClient.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
    */
347 347
   private function parseResponseBody(ResponseInterface $response): ?array
348 348
   {
349
-    $body = (string)$response->getBody();
349
+    $body = (string) $response->getBody();
350 350
     if (empty($body))
351 351
     {
352 352
       if ($response->getStatusCode()===self::HTTP_NO_CONTENT)
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
       throw new ClubCollectApiException("Unable to decode ClubCollect response: '{$body}'.");
364 364
     }
365 365
 
366
-    if ($response->getStatusCode()>=400)
366
+    if ($response->getStatusCode() >= 400)
367 367
     {
368 368
       throw ClubCollectApiException::createFromResponse($response);
369 369
     }
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,10 +179,10 @@
 block discarded – undo
179 179
                                   ?array $body = null): ?array
180 180
   {
181 181
     $url = sprintf('%s/%s%s%s',
182
-                   $this->apiEndpoint,
183
-                   self::API_VERSION,
184
-                   $this->composePath($path),
185
-                   $this->composeQuery($query));
182
+                    $this->apiEndpoint,
183
+                    self::API_VERSION,
184
+                    $this->composePath($path),
185
+                    $this->composeQuery($query));
186 186
 
187 187
     return $this->performHttpCallToFullUrl($httpMethod, $url, $this->composeRequestBody($body));
188 188
   }
Please login to merge, or discard this patch.
src/Endpoint/InvoiceEndpoint.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -96,36 +96,36 @@  discard block
 block discarded – undo
96 96
    * @throws ClubCollectApiException
97 97
    */
98 98
   public function create(string $importId,
99
-                         string $externalInvoiceNumber,
99
+                          string $externalInvoiceNumber,
100 100
                          ?string $reference,
101 101
                          ?string $directDebitIban,
102 102
                          ?string $federationMembershipNumber,
103 103
                          ?string $clubMembershipNumber,
104 104
                          ?string $locale,
105
-                         array $customerName,
106
-                         array $customerAddress,
107
-                         array $customerEmail,
108
-                         array $customerPhone,
109
-                         array $invoiceLines,
110
-                         int $amountTotalCents): Invoice
105
+                          array $customerName,
106
+                          array $customerAddress,
107
+                          array $customerEmail,
108
+                          array $customerPhone,
109
+                          array $invoiceLines,
110
+                          int $amountTotalCents): Invoice
111 111
   {
112 112
     /** @var Invoice $resource */
113 113
     $resource = parent::restPost(
114 114
       ['invoices'],
115 115
       ['api_key' => $this->client->getApiKey()],
116 116
       ['import_id'                    => $importId,
117
-       'external_invoice_number'      => $externalInvoiceNumber,
118
-       'reference'                    => $reference,
119
-       'direct_debit_iban'            => $directDebitIban,
120
-       'federation_membership_number' => Cast::toOptString($federationMembershipNumber),
121
-       'club_membership_number'       => Cast::toOptString($clubMembershipNumber),
122
-       'locale'                       => $locale,
123
-       'customer'                     => self::composeCustomer($customerName,
124
-                                                               $customerAddress,
125
-                                                               $customerEmail,
126
-                                                               $customerPhone),
127
-       'invoice_lines'                => self::composeInvoiceLines($invoiceLines),
128
-       'amount_total_cents'           => $amountTotalCents]);
117
+        'external_invoice_number'      => $externalInvoiceNumber,
118
+        'reference'                    => $reference,
119
+        'direct_debit_iban'            => $directDebitIban,
120
+        'federation_membership_number' => Cast::toOptString($federationMembershipNumber),
121
+        'club_membership_number'       => Cast::toOptString($clubMembershipNumber),
122
+        'locale'                       => $locale,
123
+        'customer'                     => self::composeCustomer($customerName,
124
+                                                                $customerAddress,
125
+                                                                $customerEmail,
126
+                                                                $customerPhone),
127
+        'invoice_lines'                => self::composeInvoiceLines($invoiceLines),
128
+        'amount_total_cents'           => $amountTotalCents]);
129 129
     if (!is_a($resource, Invoice::class))
130 130
     {
131 131
       throw new ClubCollectApiException('Expected an Invoice object, got a %s', get_class($resource));
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
    * @throws ClubCollectApiException
149 149
    */
150 150
   public function credit(string $invoiceId,
151
-                         string $externalInvoiceNumber,
152
-                         array $invoiceLines,
153
-                         int $amountTotalCents): Invoice
151
+                          string $externalInvoiceNumber,
152
+                          array $invoiceLines,
153
+                          int $amountTotalCents): Invoice
154 154
   {
155 155
     /** @var Invoice $resource */
156 156
     $resource = parent::restPost(['invoices', $invoiceId, 'credit'],
157
-                                 ['api_key' => $this->client->getApiKey()],
158
-                                 ['external_invoice_number' => $externalInvoiceNumber,
157
+                                  ['api_key' => $this->client->getApiKey()],
158
+                                  ['external_invoice_number' => $externalInvoiceNumber,
159 159
                                   'invoice_lines'           => self::composeInvoiceLines($invoiceLines),
160 160
                                   'amount_total_cents'      => $amountTotalCents]);
161 161
 
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
    * @throws ClubCollectApiException
184 184
    */
185 185
   public function creditAndRetract(string $invoiceId,
186
-                                   string $externalInvoiceNumber,
187
-                                   string $description,
186
+                                    string $externalInvoiceNumber,
187
+                                    string $description,
188 188
                                    ?string $retractionReason,
189 189
                                    ?bool $showRetractionReasonToCustomer): Invoice
190 190
   {
191 191
     /** @var Invoice $resource */
192 192
     $resource = parent::restPost(['invoices', $invoiceId, 'credit_and_retract'],
193
-                                 ['api_key' => $this->client->getApiKey()],
194
-                                 ['external_invoice_number'            => $externalInvoiceNumber,
193
+                                  ['api_key' => $this->client->getApiKey()],
194
+                                  ['external_invoice_number'            => $externalInvoiceNumber,
195 195
                                   'description'                        => $description,
196 196
                                   'retraction_reason'                  => $retractionReason,
197 197
                                   'show_retraction_reason_to_customer' => $showRetractionReasonToCustomer]);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
   public function delete(string $invoiceId): void
216 216
   {
217 217
     parent::restDelete(['invoices', $invoiceId],
218
-                       ['api_key' => $this->client->getApiKey()]);
218
+                        ['api_key' => $this->client->getApiKey()]);
219 219
   }
220 220
 
221 221
   //--------------------------------------------------------------------------------------------------------------------
@@ -263,31 +263,31 @@  discard block
 block discarded – undo
263 263
    * @throws ClubCollectApiException
264 264
    */
265 265
   public function update(string $invoiceId,
266
-                         string $externalInvoiceNumber,
266
+                          string $externalInvoiceNumber,
267 267
                          ?string $reference,
268 268
                          ?string $directDebitIban,
269 269
                          ?string $federationMembershipNumber,
270 270
                          ?string $clubMembershipNumber,
271 271
                          ?string $locale,
272
-                         array $customerName,
273
-                         array $customerAddress,
274
-                         array $customerEmail,
275
-                         array $customerPhone): Invoice
272
+                          array $customerName,
273
+                          array $customerAddress,
274
+                          array $customerEmail,
275
+                          array $customerPhone): Invoice
276 276
   {
277 277
     /** @var Invoice $resource */
278 278
     $resource = parent::restPut(
279 279
       ['invoices', $invoiceId],
280 280
       ['api_key' => $this->client->getApiKey()],
281 281
       ['external_invoice_number'      => $externalInvoiceNumber,
282
-       'reference'                    => $reference,
283
-       'direct_debit_iban'            => $directDebitIban,
284
-       'federation_membership_number' => Cast::toOptString($federationMembershipNumber),
285
-       'club_membership_number'       => Cast::toOptString($clubMembershipNumber),
286
-       'locale'                       => $locale,
287
-       'customer'                     => self::composeCustomer($customerName,
288
-                                                               $customerAddress,
289
-                                                               $customerEmail,
290
-                                                               $customerPhone)]);
282
+        'reference'                    => $reference,
283
+        'direct_debit_iban'            => $directDebitIban,
284
+        'federation_membership_number' => Cast::toOptString($federationMembershipNumber),
285
+        'club_membership_number'       => Cast::toOptString($clubMembershipNumber),
286
+        'locale'                       => $locale,
287
+        'customer'                     => self::composeCustomer($customerName,
288
+                                                                $customerAddress,
289
+                                                                $customerEmail,
290
+                                                                $customerPhone)]);
291 291
     if (!is_a($resource, Invoice::class))
292 292
     {
293 293
       throw new ClubCollectApiException('Expected an Invoice object, got a %s', get_class($resource));
Please login to merge, or discard this patch.