diff --git a/composer.json b/composer.json index f3afe122..58cc2c0e 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "php": "^8.0", "ext-curl": "*", "ext-json": "*", - "netresearch/jsonmapper": "^3.0|^4.0|^5.0", + "netresearch/jsonmapper": "^4.2", "monolog/monolog": "^2.0|^3.0" }, "suggest": { diff --git a/src/Issue/Version.php b/src/Issue/Version.php index eb3b23a6..30b57ed1 100644 --- a/src/Issue/Version.php +++ b/src/Issue/Version.php @@ -11,27 +11,27 @@ class Version implements \JsonSerializable public string $id; // Version name: ex: 4.2.3 - public ?string $name; + public string $name; // version description: ex; improvement performance - public ?string $description; + public ?string $description = null; public bool $archived; public bool $released; - public string $releaseDate; + public ?string $releaseDate = null; - public bool $overdue; + public bool $overdue = false; - public ?string $userReleaseDate; + public ?string $userReleaseDate = null; public int $projectId; - public ?string $startDate; - public ?string $userStartDate; + public ?string $startDate = null; + public ?string $userStartDate = null; - public function __construct($name = null) + public function __construct(string $name) { $this->name = $name; } diff --git a/src/Version/VersionService.php b/src/Version/VersionService.php index 17512e6b..fee0ab48 100644 --- a/src/Version/VersionService.php +++ b/src/Version/VersionService.php @@ -35,7 +35,7 @@ public function create($version) return $this->json_mapper->map( json_decode($ret), - new Version() + Version::class ); } @@ -71,7 +71,7 @@ public function get(string $id) return $this->json_mapper->map( json_decode($ret), - new Version() + Version::class ); } @@ -100,7 +100,7 @@ public function update(Version $version): Version return $this->json_mapper->map( json_decode($ret), - new Version() + Version::class ); }