Skip to content

Commit

Permalink
TASK: Remove obsolete workspaceName from NodeIdToPublishOrDiscard
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaeslich committed Mar 14, 2024
1 parent 25e0d3b commit 43827ba
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ public function jsonSerialize(): array
public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
$this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
&& $this->originDimensionSpacePoint->equals($nodeIdToPublish->dimensionSpacePoint)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public function jsonSerialize(): array
public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->coveredDimensionSpacePoint === $nodeIdToPublish->dimensionSpacePoint
$this->coveredDimensionSpacePoint === $nodeIdToPublish->dimensionSpacePoint
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public function jsonSerialize(): array
public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->coveredDimensionSpacePoint === $nodeIdToPublish->dimensionSpacePoint
$this->coveredDimensionSpacePoint === $nodeIdToPublish->dimensionSpacePoint
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
);
return (
!is_null($targetNodeAggregateId)
&& $this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->targetDimensionSpacePoint->equals($nodeIdToPublish->dimensionSpacePoint)
&& $targetNodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public function jsonSerialize(): array
public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->originDimensionSpacePoint->equals($nodeIdToPublish->dimensionSpacePoint)
$this->originDimensionSpacePoint->equals($nodeIdToPublish->dimensionSpacePoint)
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public function jsonSerialize(): array

public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return $this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
return $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
&& $this->dimensionSpacePoint === $nodeIdToPublish->dimensionSpacePoint;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ public function jsonSerialize(): array

public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->sourceOriginDimensionSpacePoint->equals($nodeIdToPublish->dimensionSpacePoint)
return ($this->sourceOriginDimensionSpacePoint->equals($nodeIdToPublish->dimensionSpacePoint)
&& $this->sourceNodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public function jsonSerialize(): array
public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
$this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
&& $this->coveredDimensionSpacePoint === $nodeIdToPublish->dimensionSpacePoint
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ public function jsonSerialize(): array

public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return (
$this->workspaceName->equals($nodeIdToPublish->workspaceName)
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
);
return $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId);
}

public function createCopyForWorkspace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ public static function fromArray(array $array): self

public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return $this->workspaceName === $nodeIdToPublish->workspaceName
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId);
return $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public function jsonSerialize(): array

public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
{
return $this->workspaceName->equals($nodeIdToPublish->workspaceName)
&& $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
return $this->nodeAggregateId->equals($nodeIdToPublish->nodeAggregateId)
&& $this->targetOrigin->equals($nodeIdToPublish->dimensionSpacePoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
final readonly class NodeIdToPublishOrDiscard implements \JsonSerializable
{
public function __construct(
/** @todo do we really need this? should be unique per command, not per node in the command */
public WorkspaceName $workspaceName,
public NodeAggregateId $nodeAggregateId,
public DimensionSpacePoint $dimensionSpacePoint,
) {
Expand All @@ -43,7 +41,6 @@ public function __construct(
public static function fromArray(array $array): self
{
return new self(
WorkspaceName::fromString($array['workspaceName']),
NodeAggregateId::fromString($array['nodeAggregateId']),
DimensionSpacePoint::fromArray($array['dimensionSpacePoint']),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Neos\ContentRepository\Core\Feature\NodeVariation\Command\CreateNodeVariant;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepositoryRegistry\Command\MigrateEventsCommandController;
use Neos\ContentRepositoryRegistry\Factory\EventStore\DoctrineEventStoreFactory;
use Neos\EventStore\EventStoreInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ public function publishNodeAction(string $nodeAddress, WorkspaceName $selectedWo
$selectedWorkspace,
NodeIdsToPublishOrDiscard::create(
new NodeIdToPublishOrDiscard(
$selectedWorkspace,
$nodeAddress->nodeAggregateId,
$nodeAddress->dimensionSpacePoint
)
Expand Down Expand Up @@ -560,7 +559,6 @@ public function discardNodeAction(string $nodeAddress, WorkspaceName $selectedWo
$selectedWorkspace,
NodeIdsToPublishOrDiscard::create(
new NodeIdToPublishOrDiscard(
$selectedWorkspace,
$nodeAddress->nodeAggregateId,
$nodeAddress->dimensionSpacePoint
)
Expand Down Expand Up @@ -598,7 +596,6 @@ public function publishOrDiscardNodesAction(array $nodes, string $action, string
foreach ($nodes as $node) {
$nodeAddress = $nodeAddressFactory->createFromUriString($node);
$nodesToPublishOrDiscard[] = new NodeIdToPublishOrDiscard(
$selectedWorkspaceName,
$nodeAddress->nodeAggregateId,
$nodeAddress->dimensionSpacePoint
);
Expand Down

0 comments on commit 43827ba

Please sign in to comment.