-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Introduce BaseWorkspaceUnchangedException to avoid no-op for Ch…
…angeBaseWorkspace
- Loading branch information
Showing
3 changed files
with
31 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
....Core/Classes/Feature/WorkspaceModification/Exception/BaseWorkspaceUnchangedException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Exception; | ||
|
||
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; | ||
|
||
/** | ||
* Exception when attempting to change the base workspace to the currently set base workspace | ||
* | ||
* The case is not handled gracefully with a no-op as there would be no traces (emitted events) of the handled command. | ||
* This exception denoting the operation is obsolete hardens the interaction. | ||
* | ||
* @api | ||
*/ | ||
final class BaseWorkspaceUnchangedException extends \RuntimeException | ||
{ | ||
public static function becauseTheAttemptedBaseWorkspaceIsTheBase(WorkspaceName $attemptedBaseWorkspaceName, WorkspaceName $workspaceName): self | ||
{ | ||
return new self(sprintf('Skipped changing the base workspace to "%s" from workspace "%s" because its already set.', $attemptedBaseWorkspaceName->value, $workspaceName->value), 1737534132); | ||
} | ||
} |