Skip to content

Commit 21331c4

Browse files
authored
disable strict object type check in JsonMapper (lesstif#541)
Since version 5 of the JsonMapper the property bStrictObjectTypeChecking is true by default. This causes error when mapping string dates to DateTimeInterface. This fix sets the property to false.
1 parent d203e9c commit 21331c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/JiraClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public function __construct(ConfigurationInterface $configuration = null, Logger
7979
// Properties that are annotated with `@var \DateTimeInterface` should result in \DateTime objects being created.
8080
$this->json_mapper->classMap['\\'.\DateTimeInterface::class] = \DateTime::class;
8181

82+
// Just class mapping is not enough, bStrictObjectTypeChecking must be set to false.
83+
$this->json_mapper->bStrictObjectTypeChecking = false;
84+
8285
// create logger
8386
if ($this->configuration->getJiraLogEnabled()) {
8487
if ($logger) {

0 commit comments

Comments
 (0)