-
Notifications
You must be signed in to change notification settings - Fork 278
Closed
Description
\JiraRestApi\Issue\Worklog
/**
* Function to set visibility of worklog.
*
* @param string $type value can be group or role
* @param string $value
*
* @return Worklog
*/
public function setVisibility($type, $value)
{
$this->visibility = [
'type' => $type,
'value' => $value,
];
return $this;
}
In this code setVisibility
has 2 parameters, both are annotated as string.
Worklog json visibility looks like this
"visibility": {
"type": "role",
"value": "Developers"
},
so json mapper converts value as stdClass
When JsonMapper tries to detect type of visibility
property, it reads first annotation parameter type in setVisibility
method, since it believes that this is a setter for class:
\JsonMapper::inspectProperty
After that it tries to case object of stdClass
to string
which causes
Recoverable fatal error: Object of class stdClass could not be converted to string in
JsonMapper->map()
Metadata
Metadata
Assignees
Labels
No labels