Skip to content

Commit 48840db

Browse files
committed
Bugfix: array_filter would also filter the false-boolean
1 parent 1925e8e commit 48840db

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/XML/md/AbstractIndexedEndpointType.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ public function toArray(): array
260260
$data['index'] = $this->getIndex()->toInteger();
261261
$data['isDefault'] = $this->getIsDefault()?->toBoolean();
262262

263-
return array_filter($data);
263+
return array_filter(
264+
$data,
265+
function ($v, $k) {
266+
return $v !== null;
267+
},
268+
ARRAY_FILTER_USE_BOTH,
269+
);
264270
}
265271
}

0 commit comments

Comments
 (0)