Skip to content

Commit 4c17f8f

Browse files
committed
Merge branch 'develop' of github.com:spinen/connectwise-php-client into develop
2 parents 2dbd496 + e25f2b0 commit 4c17f8f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ jobs:
3636
- name: Install dependencies
3737
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
3838

39+
- name: PHP Security Checker
40+
uses: symfonycorp/security-checker-action@v2
41+
if: ${{ matrix.stability == 'prefer-stable' }}
42+
3943
- name: Execute tests
4044
run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose
4145

4246
- name: Upload Code Coverage
43-
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover
47+
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover

src/Api/Client.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,10 @@ public function buildAuth()
224224
*/
225225
public function buildOptions(array $options = [])
226226
{
227-
return array_merge_recursive(
228-
$options,
229-
[
230-
'headers' => $this->getHeaders(),
231-
]
232-
);
227+
return [
228+
'body' => json_encode($options ?? []),
229+
'headers' => $this->getHeaders(),
230+
];
233231
}
234232

235233
/**
@@ -340,7 +338,7 @@ public function getPassword()
340338
*
341339
* @return string
342340
*/
343-
public function getUrl($path = null)
341+
public function getUrl($path = '')
344342
{
345343
return $this->url . '/v4_6_release/apis/3.0/' . ltrim($path, '/');
346344
}
@@ -395,7 +393,7 @@ protected function isCollection(array $array)
395393
*/
396394
protected function isLastPage(ResponseInterface $response)
397395
{
398-
return !(bool)preg_match('/rel="last"$/u', $response->getHeader('Link')[0] ?? null);
396+
return !(bool)preg_match('/rel="last"$/u', $response->getHeader('Link')[0] ?? '');
399397
}
400398

401399
/**

tests/Api/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function it_builds_the_expected_options_array()
294294
$this->client->setIntegrator($username);
295295

296296
$options = [
297-
'extra' => 'option',
297+
'body' => json_encode(['extra' => 'option']),
298298
'headers' => [
299299
'added' => 'header',
300300
'Accept' => 'application/vnd.connectwise.com+json; version=2019.5',

0 commit comments

Comments
 (0)