Skip to content

Commit 9cc0852

Browse files
committed
Cast values to array
1 parent 4a9a2ca commit 9cc0852

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/PHPCR/Util/Console/Helper/TreeDumper/ConsoleDumperPropertyVisitor.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,13 @@ public function visit(ItemInterface $item)
9696

9797

9898
if ('path' == $this->refFormat) {
99-
$references = $item->getValue();
100-
if (!is_array($references)) {
101-
$references = array($references);
102-
}
99+
$references = (array) $item->getValue();
103100

104101
foreach ($references as $reference) {
105102
$referenceStrings[] = $reference->getPath();
106103
}
107-
108104
} else {
109-
$referenceStrings = $item->getString();
110-
if (!is_array($referenceStrings)) {
111-
$referenceStrings = array($referenceStrings);
112-
}
105+
$referenceStrings = (array) $item->getString();
113106
}
114107

115108
$value = '';

0 commit comments

Comments
 (0)