Skip to content

Commit 6a21d6d

Browse files
committed
Replace code using Value Objects
This changeset was created with a new rector ruleset (see neos/rector#11)
1 parent a0b79fe commit 6a21d6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Classes/Authorization/Privilege/Node/NodePrivilegeContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function isAncestorNodeOf(string $nodePathOrIdentifier): bool
6161
return $nodePathOrResult;
6262
}
6363

64-
return str_starts_with($nodePathOrResult, (string)$this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId));
64+
return str_starts_with($nodePathOrResult, $this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId)->value);
6565
}
6666

6767
/**
@@ -80,7 +80,7 @@ public function isDescendantNodeOf(string $nodePathOrIdentifier): bool
8080
return $nodePathOrResult;
8181
}
8282

83-
return str_starts_with((string)$this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId), $nodePathOrResult);
83+
return str_starts_with($this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId)->value, $nodePathOrResult);
8484
}
8585

8686
/**
@@ -138,7 +138,7 @@ public function isInWorkspace(array $workspaceNames): bool
138138
$workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId(
139139
$this->node->subgraphIdentity->contentStreamId
140140
);
141-
return !is_null($workspace) && in_array((string)$workspace->workspaceName, $workspaceNames);
141+
return !is_null($workspace) && in_array($workspace->workspaceName->value, $workspaceNames);
142142
}
143143

144144
/**
@@ -186,7 +186,7 @@ protected function resolveNodePathOrResult(string $nodePathOrIdentifier): bool|s
186186
if (is_null($otherNode)) {
187187
return false;
188188
}
189-
return $this->getSubgraph()->retrieveNodePath($otherNode->nodeAggregateId) . '/';
189+
return $this->getSubgraph()->retrieveNodePath($otherNode->nodeAggregateId)->value . '/';
190190
} catch (\InvalidArgumentException $e) {
191191
return rtrim($nodePathOrIdentifier, '/') . '/';
192192
}

0 commit comments

Comments
 (0)