Skip to content

Commit

Permalink
Merge pull request #98 from johnzuk/feature/php8.0-support
Browse files Browse the repository at this point in the history
Add PHP8.0 support
  • Loading branch information
johnzuk authored Dec 4, 2020
2 parents d4c023a + dff8681 commit edb4112
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0

allow_failures:
php: nightly
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
}
],
"require": {
"php" : "^7.1",
"php" : "^7.1|^8.0",
"ext-soap": "*",
"ext-simplexml": "*",
"ext-json": "*"
},
"require-dev": {
"phpstan/phpstan-shim": "^0.11",
"phpunit/phpunit": "^7.0 | ^8.0",
"squizlabs/php_codesniffer": "^3.4",
"friendsofphp/php-cs-fixer": "^2.11"
"friendsofphp/php-cs-fixer": "^2.11",
"phpstan/phpstan": "^0.12.58"
},
"autoload":{
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
parameters:
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
excludes_analyse:
- src/GusApi/Client/SoapClient.php
ignoreErrors:
- '#Method GusApi\\Client\\GusApiClient::call\(\) has no return typehint specified#'
2 changes: 1 addition & 1 deletion src/GusApi/Client/GusApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function setHttpOptions(array $options): void
]);
}

protected function call(string $functionName, $arguments, ?string $sid = null)
protected function call(string $functionName, array $arguments, ?string $sid = null)
{
$action = SoapActionMapper::getAction($functionName);
$soapHeaders = $this->getRequestHeaders($action, $this->location);
Expand Down
2 changes: 1 addition & 1 deletion src/GusApi/GusApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public function getSessionStatus(): int
*
* @throws \InvalidArgumentException
*/
protected function checkIdentifiersCount(array $identifiers)
protected function checkIdentifiersCount(array $identifiers): void
{
if (\count($identifiers) > self::MAX_IDENTIFIERS) {
throw new \InvalidArgumentException(\sprintf(
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/GusApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public function testGetByInvalidNipAndGetMessage()
$this->expectException(NotFoundException::class);

try {
self::$apiClient->getByNip('0123456789');
self::$apiClient->getByNip('0123456700');
} finally {
$this->assertSame(1, self::$apiClient->getSessionStatus());
$this->assertSame('Nie znaleziono podmiotów.', self::$apiClient->getMessage());
$this->assertSame(4, self::$apiClient->getMessageCode());
$this->assertSame('', self::$apiClient->getMessage());
$this->assertSame(0, self::$apiClient->getMessageCode());
}
}

Expand Down

0 comments on commit edb4112

Please sign in to comment.