From 307a83c324459587295a091360877579f60b4143 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:41:56 +0200 Subject: [PATCH] TASK: Task rename Neos.Neos `WorkspaceName` to `NeosWorkspaceName` This will make it easier to import the correct Neos CR WorkspaceName - which one will want to use more likely. Resolves partially #4341 --- .../Controller/Module/Management/WorkspacesController.php | 2 +- .../Model/{WorkspaceName.php => NeosWorkspaceName.php} | 6 +++--- Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php | 4 ++-- Neos.Neos/Classes/Utility/User.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename Neos.Neos/Classes/Domain/Model/{WorkspaceName.php => NeosWorkspaceName.php} (92%) diff --git a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php index bf782bfc86f..19c5bc417e6 100644 --- a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php @@ -48,7 +48,7 @@ use Neos\Diff\Diff; use Neos\Diff\Renderer\Html\HtmlArrayRenderer; use Neos\Neos\Controller\Module\ModuleTranslationTrait; -use Neos\Neos\Domain\Model\WorkspaceName as NeosWorkspaceName; +use Neos\Neos\Domain\Model\NeosWorkspaceName; use Neos\Flow\Annotations as Flow; use Neos\Error\Messages\Message; use Neos\Flow\Mvc\ActionRequest; diff --git a/Neos.Neos/Classes/Domain/Model/WorkspaceName.php b/Neos.Neos/Classes/Domain/Model/NeosWorkspaceName.php similarity index 92% rename from Neos.Neos/Classes/Domain/Model/WorkspaceName.php rename to Neos.Neos/Classes/Domain/Model/NeosWorkspaceName.php index c59ba79951d..a4251c3a4b8 100644 --- a/Neos.Neos/Classes/Domain/Model/WorkspaceName.php +++ b/Neos.Neos/Classes/Domain/Model/NeosWorkspaceName.php @@ -17,10 +17,10 @@ use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName as ContentRepositoryWorkspaceName; /** - * The workspace name value for Neos contexts + * The workspace name with domain logic for Neos.Neos * Directly translatable to CR workspace names */ -final class WorkspaceName implements \JsonSerializable, \Stringable +final class NeosWorkspaceName implements \JsonSerializable, \Stringable { public const PREFIX = 'user-'; public const SUFFIX_DELIMITER = '_'; @@ -58,7 +58,7 @@ public function increment(array $takenWorkspaceNames): self } if ($i > 1) { - return new WorkspaceName($name); + return new self($name); } else { return $this; } diff --git a/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php b/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php index 16054d16bae..f32f4946aed 100644 --- a/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php +++ b/Neos.Neos/Classes/Service/EditorContentStreamZookeeper.php @@ -26,7 +26,7 @@ use Neos\ContentRepositoryRegistry\Factory\ProjectionCatchUpTrigger\CatchUpTriggerWithSynchronousOption; use Neos\Flow\Core\Bootstrap; use Neos\Flow\Http\HttpRequestHandlerInterface; -use Neos\Neos\Domain\Model\WorkspaceName as AdjustmentsWorkspaceName; +use Neos\Neos\Domain\Model\NeosWorkspaceName; use Neos\Flow\Annotations as Flow; use Neos\Flow\Persistence\PersistenceManagerInterface; use Neos\Flow\Security\Authentication; @@ -106,7 +106,7 @@ public function relayEditorAuthentication(Authentication\TokenInterface $token): if ($isEditor) { $user = $this->partyService->getAssignedPartyOfAccount($token->getAccount()); if ($user instanceof User) { - $workspaceName = AdjustmentsWorkspaceName::fromAccountIdentifier( + $workspaceName = NeosWorkspaceName::fromAccountIdentifier( $token->getAccount()->getAccountIdentifier() ); $workspace = $contentRepository->getWorkspaceFinder()->findOneByName( diff --git a/Neos.Neos/Classes/Utility/User.php b/Neos.Neos/Classes/Utility/User.php index 051eedb8fb5..5a6ceae7492 100644 --- a/Neos.Neos/Classes/Utility/User.php +++ b/Neos.Neos/Classes/Utility/User.php @@ -2,7 +2,7 @@ namespace Neos\Neos\Utility; -use Neos\Neos\Domain\Model\WorkspaceName; +use Neos\Neos\Domain\Model\NeosWorkspaceName; /** * Utility functions for dealing with users in the Content Repository. @@ -17,7 +17,7 @@ class User */ public static function getPersonalWorkspaceNameForUsername($username): string { - return (string)WorkspaceName::fromAccountIdentifier($username); + return (string)NeosWorkspaceName::fromAccountIdentifier($username); } /**