We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2aea25a + fbace7b commit cb0c797Copy full SHA for cb0c797
src/Issue/Reporter.php
@@ -24,12 +24,17 @@ class Reporter implements \JsonSerializable
24
25
public function jsonSerialize()
26
{
27
- return array_filter(get_object_vars($this), function ($value, $key) {
28
- // allow empty assignee. See https://github.com/lesstif/php-jira-rest-client/issues/18
+ $vars = (get_object_vars($this));
+ foreach($vars as $key => $value) {
29
if ($key === 'name' && !is_null($value)) {
30
- return true;
+ continue;
31
+ }elseif(is_null($value) || $value === '') {
32
+ unset($vars[$key]);
33
}
- return !empty($value);
- }, ARRAY_FILTER_USE_BOTH);
34
+ }
35
+ if(empty($vars)) {
36
+ return null;
37
38
+ return $vars;
39
40
0 commit comments