Skip to content

Commit d29c13a

Browse files
committed
Apply suggestions from code review
1 parent ca88c8c commit d29c13a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib/Repository/ContentService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,14 +2532,14 @@ public function deleteTranslationFromDraft(APIVersionInfo $versionInfo, string $
25322532
public function hideContent(ContentInfo $contentInfo): void
25332533
{
25342534
// If ContentInfo is in draft state, mainLocationId is yet not set
2535-
$locationTarget = $contentInfo->isDraft()
2535+
$targets = $contentInfo->isDraft()
25362536
? []
25372537
: [new DestinationLocationTarget($contentInfo->getMainLocationId(), $contentInfo)];
25382538
if (!$this->permissionResolver->canUser(
25392539
'content',
25402540
'hide',
25412541
$contentInfo,
2542-
$locationTarget
2542+
$targets
25432543
)) {
25442544
throw new UnauthorizedException('content', 'hide', ['contentId' => $contentInfo->id]);
25452545
}
@@ -2575,15 +2575,15 @@ public function hideContent(ContentInfo $contentInfo): void
25752575
public function revealContent(ContentInfo $contentInfo): void
25762576
{
25772577
// If ContentInfo is in draft state, mainLocationId is yet not set
2578-
$locationTarget = $contentInfo->isDraft()
2578+
$targets = $contentInfo->isDraft()
25792579
? []
25802580
: [new DestinationLocationTarget($contentInfo->getMainLocationId(), $contentInfo)];
25812581

25822582
if (!$this->permissionResolver->canUser(
25832583
'content',
25842584
'hide',
25852585
$contentInfo,
2586-
$locationTarget
2586+
$targets
25872587
)) {
25882588
throw new UnauthorizedException('content', 'hide', ['contentId' => $contentInfo->id]);
25892589
}

0 commit comments

Comments
 (0)