Test Failed
Push — master ( 6b615f...c406fd )
by P.R.
02:45
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   +38 added lines, -38 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));
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
    * @throws ClubCollectApiException
151 151
    */
152 152
   public function creditAndRetract(string $invoiceId,
153
-                                   string $externalInvoiceNumber,
154
-                                   string $description,
153
+                                    string $externalInvoiceNumber,
154
+                                    string $description,
155 155
                                    ?string $retractionReason,
156 156
                                    ?bool $showRetractionReasonToCustomer): Invoice
157 157
   {
158 158
     /** @var Invoice $resource */
159 159
     $resource = parent::restPost(['invoices', $invoiceId, 'credit_and_retract'],
160
-                                 ['api_key' => $this->client->getApiKey()],
161
-                                 ['external_invoice_number'            => $externalInvoiceNumber,
160
+                                  ['api_key' => $this->client->getApiKey()],
161
+                                  ['external_invoice_number'            => $externalInvoiceNumber,
162 162
                                   'description'                        => $description,
163 163
                                   'retraction_reason'                  => $retractionReason,
164 164
                                   'show_retraction_reason_to_customer' => $showRetractionReasonToCustomer]);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
   public function delete(string $invoiceId): void
183 183
   {
184 184
     parent::restDelete(['invoices', $invoiceId],
185
-                       ['api_key' => $this->client->getApiKey()]);
185
+                        ['api_key' => $this->client->getApiKey()]);
186 186
   }
187 187
 
188 188
   //--------------------------------------------------------------------------------------------------------------------
@@ -230,31 +230,31 @@  discard block
 block discarded – undo
230 230
    * @throws ClubCollectApiException
231 231
    */
232 232
   public function update(string $invoiceId,
233
-                         string $externalInvoiceNumber,
233
+                          string $externalInvoiceNumber,
234 234
                          ?string $reference,
235 235
                          ?string $directDebitIban,
236 236
                          ?string $federationMembershipNumber,
237 237
                          ?string $clubMembershipNumber,
238 238
                          ?string $locale,
239
-                         array $customerName,
240
-                         array $customerAddress,
241
-                         array $customerEmail,
242
-                         array $customerPhone): Invoice
239
+                          array $customerName,
240
+                          array $customerAddress,
241
+                          array $customerEmail,
242
+                          array $customerPhone): Invoice
243 243
   {
244 244
     /** @var Invoice $resource */
245 245
     $resource = parent::restPut(
246 246
       ['invoices', $invoiceId],
247 247
       ['api_key' => $this->client->getApiKey()],
248 248
       ['external_invoice_number'      => $externalInvoiceNumber,
249
-       'reference'                    => $reference,
250
-       'direct_debit_iban'            => $directDebitIban,
251
-       'federation_membership_number' => Cast::toOptString($federationMembershipNumber),
252
-       'club_membership_number'       => Cast::toOptString($clubMembershipNumber),
253
-       'locale'                       => $locale,
254
-       'customer'                     => self::composeCustomer($customerName,
255
-                                                               $customerAddress,
256
-                                                               $customerEmail,
257
-                                                               $customerPhone)]);
249
+        'reference'                    => $reference,
250
+        'direct_debit_iban'            => $directDebitIban,
251
+        'federation_membership_number' => Cast::toOptString($federationMembershipNumber),
252
+        'club_membership_number'       => Cast::toOptString($clubMembershipNumber),
253
+        'locale'                       => $locale,
254
+        'customer'                     => self::composeCustomer($customerName,
255
+                                                                $customerAddress,
256
+                                                                $customerEmail,
257
+                                                                $customerPhone)]);
258 258
     if (!is_a($resource, Invoice::class))
259 259
     {
260 260
       throw new ClubCollectApiException('Expected an Invoice object, got a %s', get_class($resource));
Please login to merge, or discard this patch.