Skip to content

Commit

Permalink
TASK: Apply suggestions from review
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Dec 10, 2024
1 parent 31473fb commit 5cc7e0f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @api because exception is thrown during invariant checks on command execution or when attempting to query a non-existing workspace
*/
final class WorkspaceDoesNotExist extends \RuntimeException
final class WorkspaceDoesNotExist extends \DomainException
{
public static function butWasSupposedTo(WorkspaceName $name): self
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function contains(WorkspaceRoleAssignment $assignment): bool
return false;
}

public function add(WorkspaceRoleAssignment $assignment): self
public function withAssignment(WorkspaceRoleAssignment $assignment): self
{
return new self(...[...$this->assignments, $assignment]);
}
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Domain/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getPersonalWorkspaceForUser(ContentRepositoryId $contentReposito
{
$workspaceName = $this->metadataAndRoleRepository->findPrimaryWorkspaceNameForUser($contentRepositoryId, $userId);
if ($workspaceName === null) {
throw new \RuntimeException(sprintf('No workspace is assigned to the user with id "%s")', $userId->value), 1733755300);
throw new \RuntimeException(sprintf('No workspace is assigned to the user with id "%s")', $userId->value), 1718293801);
}
return $this->requireWorkspace($contentRepositoryId, $workspaceName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function theSharedWorkspaceIsCreatedWithTheTargetWorkspace(string $worksp
{
$workspaceRoleAssignments = WorkspaceRoleAssignments::createEmpty();
foreach ($rawRoleAssignments?->getHash() ?? [] as $row) {
$workspaceRoleAssignments = $workspaceRoleAssignments->add(WorkspaceRoleAssignment::create(
$workspaceRoleAssignments = $workspaceRoleAssignments->withAssignment(WorkspaceRoleAssignment::create(
WorkspaceRoleSubject::create(
WorkspaceRoleSubjectType::from($row['Type']),
$row['Value']
Expand Down

0 comments on commit 5cc7e0f

Please sign in to comment.