Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:spinen/connectwise-php-client in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
ssfinney committed Feb 22, 2021
2 parents 2dbd496 + e25f2b0 commit 4c17f8f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ jobs:
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest

- name: PHP Security Checker
uses: symfonycorp/security-checker-action@v2
if: ${{ matrix.stability == 'prefer-stable' }}

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose

- name: Upload Code Coverage
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover
14 changes: 6 additions & 8 deletions src/Api/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,10 @@ public function buildAuth()
*/
public function buildOptions(array $options = [])
{
return array_merge_recursive(
$options,
[
'headers' => $this->getHeaders(),
]
);
return [
'body' => json_encode($options ?? []),
'headers' => $this->getHeaders(),
];
}

/**
Expand Down Expand Up @@ -340,7 +338,7 @@ public function getPassword()
*
* @return string
*/
public function getUrl($path = null)
public function getUrl($path = '')
{
return $this->url . '/v4_6_release/apis/3.0/' . ltrim($path, '/');
}
Expand Down Expand Up @@ -395,7 +393,7 @@ protected function isCollection(array $array)
*/
protected function isLastPage(ResponseInterface $response)
{
return !(bool)preg_match('/rel="last"$/u', $response->getHeader('Link')[0] ?? null);
return !(bool)preg_match('/rel="last"$/u', $response->getHeader('Link')[0] ?? '');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Api/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function it_builds_the_expected_options_array()
$this->client->setIntegrator($username);

$options = [
'extra' => 'option',
'body' => json_encode(['extra' => 'option']),
'headers' => [
'added' => 'header',
'Accept' => 'application/vnd.connectwise.com+json; version=2019.5',
Expand Down

0 comments on commit 4c17f8f

Please sign in to comment.