Skip to content

Commit 1d4f5f4

Browse files
author
Jamie Hannaford
committed
Merge pull request #2 from haphan/master
Skip parsing docblock if null
2 parents e1cfdfe + 72029ec commit 1d4f5f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Common/Resource/AbstractResource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public function populateFromArray(array $array): self
8282

8383
private function parseDocBlockValue(string $type, $val)
8484
{
85-
if (strpos($type, '[]') === 0 && is_array($val)) {
85+
if (is_null($val)) {
86+
return $val;
87+
} elseif (strpos($type, '[]') === 0 && is_array($val)) {
8688
$array = [];
8789
foreach ($val as $subVal) {
8890
$array[] = $this->model($this->normalizeModelClass(substr($type, 2)), $subVal);

0 commit comments

Comments
 (0)