Skip to content

Commit

Permalink
Feature: Also check for isLive
Browse files Browse the repository at this point in the history
  • Loading branch information
pKallert committed Jul 23, 2024
1 parent 68f90f0 commit a14ffe9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -960,13 +960,18 @@ private function requireNonCircularRelationBetweenWorkspaces(Workspace $workspac
if ($workspace->workspaceName->equals($baseWorkspace->workspaceName)) {
throw new BaseWorkspaceEqualsWorkspaceException(sprintf('The base workspace of the target must be different from the given workspace "%s".', $workspace->workspaceName->value));
}

$count = 1;
$nextBaseWorkspace = $baseWorkspace;
while ($nextBaseWorkspace->baseWorkspaceName->value !== 'live') {
while (!is_null($nextBaseWorkspace->baseWorkspaceName) && !$nextBaseWorkspace->baseWorkspaceName->isLive()) {
if ($workspace->workspaceName->equals($nextBaseWorkspace->baseWorkspaceName)) {
throw new CircularRelationBetweenWorkspacesException(sprintf('The workspace "%s" is already on the path of the target workspace "%s".', $workspace->workspaceName->value, $baseWorkspace->workspaceName->value));
}
$nextBaseWorkspace = $this->requireBaseWorkspace($workspace, $workspaceFinder);
$count++;
if($count == 5){
die();
}
var_dump($nextBaseWorkspace->baseWorkspaceName);
}
}

Expand Down

0 comments on commit a14ffe9

Please sign in to comment.