Skip to content

Commit

Permalink
Fixes #14: not found when KvK number starts with 0
Browse files Browse the repository at this point in the history
  • Loading branch information
nerbiz authored and airtonzanon committed Feb 18, 2019
1 parent 385f883 commit 03e44e9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use Werkspot\KvkApi\ClientFactory;
$client = ClientFactory::create('<YOUR_API_KEY>', new Production());

$profileQuery = new ProfileQuery();
$profileQuery->setKvkNumber(18079951);
$profileQuery->setKvkNumber('18079951');

$kvkPaginator = $client->getProfile($profileQuery);

Expand Down
6 changes: 3 additions & 3 deletions src/Http/Search/ProfileQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class ProfileQuery implements QueryInterface
{
/**
* @info KvK number, identifying number for a registration in the Netherlands Business Register. Consists of 8 digits
* @var int
* @var string
*/
private $kvkNumber;

Expand Down Expand Up @@ -55,12 +55,12 @@ final class ProfileQuery implements QueryInterface
*/
private $q;

public function getKvkNumber(): int
public function getKvkNumber(): string
{
return $this->kvkNumber;
}

public function setKvkNumber(int $kvkNumber): void
public function setKvkNumber(string $kvkNumber): void
{
$this->kvkNumber = $kvkNumber;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class ClientTest extends TestCase
* @test
* @dataProvider getKvkNumbers
*/
public function getProfile(int $kvkNumber): void
public function getProfile(string $kvkNumber): void
{
$client = KvkClientFactory::create('', new Testing());

Expand All @@ -39,7 +39,7 @@ public function getProfile(int $kvkNumber): void
* @dataProvider getNonExistingKvkNumbers
* @expectedException \Werkspot\KvkApi\Http\Adapter\Guzzle\Exception\NotFoundException
*/
public function getProfile_shouldThrowException(int $kvkNumber): void
public function getProfile_shouldThrowException(string $kvkNumber): void
{
$client = KvkClientFactory::create('', new Testing());

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Http/Search/ProfileQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ProfileQueryTest extends TestCase
* @test
* @dataProvider getInteger
*/
public function setKvkNumber(int $int): void
public function setKvkNumber(string $int): void
{
$profileQuery = new ProfileQuery();
$profileQuery->setKvkNumber($int);
Expand Down

0 comments on commit 03e44e9

Please sign in to comment.