From 5cc7e0f42b9d84347b64ea5bb04ea795600f5339 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:24:17 +0100 Subject: [PATCH] TASK: Apply suggestions from review --- .../Classes/SharedModel/Exception/WorkspaceDoesNotExist.php | 2 +- Neos.Neos/Classes/Domain/Model/WorkspaceRoleAssignments.php | 2 +- Neos.Neos/Classes/Domain/Service/WorkspaceService.php | 2 +- .../Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php index 67939a4bea..26004ba393 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php @@ -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 { diff --git a/Neos.Neos/Classes/Domain/Model/WorkspaceRoleAssignments.php b/Neos.Neos/Classes/Domain/Model/WorkspaceRoleAssignments.php index f381d3c80d..87b33bc0d3 100644 --- a/Neos.Neos/Classes/Domain/Model/WorkspaceRoleAssignments.php +++ b/Neos.Neos/Classes/Domain/Model/WorkspaceRoleAssignments.php @@ -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]); } diff --git a/Neos.Neos/Classes/Domain/Service/WorkspaceService.php b/Neos.Neos/Classes/Domain/Service/WorkspaceService.php index 55376a4f56..0b0f63390a 100644 --- a/Neos.Neos/Classes/Domain/Service/WorkspaceService.php +++ b/Neos.Neos/Classes/Domain/Service/WorkspaceService.php @@ -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); } diff --git a/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php b/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php index 987c830493..c89a13d6eb 100644 --- a/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php +++ b/Neos.Neos/Tests/Behavior/Features/Bootstrap/WorkspaceServiceTrait.php @@ -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']