Skip to content

Commit b329c27

Browse files
Steveb-palongosz
andcommitted
Refactored href value generation
Co-authored-by: Andrew Longosz <[email protected]>
1 parent 2b036a0 commit b329c27

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/Server/Output/ValueObjectVisitor/RestContent.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ public function visit(Visitor $visitor, Generator $generator, $data)
5252

5353
$generator->attribute(
5454
'href',
55-
$data->path === null ?
56-
$this->router->generate('ibexa.rest.load_content', ['contentId' => $contentInfo->id]) :
57-
$data->path
55+
$data->path ?? $this->router->generate(
56+
'ibexa.rest.load_content',
57+
['contentId' => $contentInfo->id]
58+
)
5859
);
5960

6061
$generator->attribute('remoteId', $contentInfo->remoteId);

0 commit comments

Comments
 (0)