aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Entities/CountryEntity.php7
-rw-r--r--tests/Entities/CountryEntityTest.php2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/Entities/CountryEntity.php b/src/Entities/CountryEntity.php
index fb559d8..37d4d6e 100644
--- a/src/Entities/CountryEntity.php
+++ b/src/Entities/CountryEntity.php
@@ -20,7 +20,6 @@ declare(strict_types = 1);
namespace EPGService\Entities;
use RuntimeException;
-use function is_int;
use function is_string;
/**
@@ -36,9 +35,9 @@ use function is_string;
*/
final class CountryEntity {
/**
- * @var int
+ * @var string
*/
- private int $id;
+ private string $id;
/**
* @var string
@@ -79,7 +78,7 @@ final class CountryEntity {
* @throws \RuntimeException
*/
public static function create(array $payload): CountryEntity {
- if (!is_int($payload['id'])) {
+ if (!is_string($payload['id'])) {
throw new RuntimeException('blah-blah-blah');
}
diff --git a/tests/Entities/CountryEntityTest.php b/tests/Entities/CountryEntityTest.php
index dd44075..ffff4fd 100644
--- a/tests/Entities/CountryEntityTest.php
+++ b/tests/Entities/CountryEntityTest.php
@@ -32,7 +32,7 @@ final class CountryEntityTest extends TestCase {
public function testCreateEntity(): void {
$faker = Faker::create();
- $id = $faker->numberBetween(1, 100);
+ $id = $faker->unique()->sha256;
$iso = $faker->countryCode;
$lang = $faker->languageCode;
$name = $faker->unique()->sha256;