Skip to content

Commit

Permalink
Remove initiatingUserId from commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed Sep 1, 2022
1 parent 8abb003 commit 4c9dd08
Show file tree
Hide file tree
Showing 25 changed files with 75 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\User\UserId;

/**
* CreateContentStream for creating the FIRST content stream.
Expand All @@ -28,7 +27,6 @@ final class CreateContentStream implements CommandInterface
{
public function __construct(
public readonly ContentStreamId $contentStreamId,
public readonly UserId $initiatingUserId
) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function __construct(
*/
public readonly ContentStreamId $newContentStreamId,
public readonly ContentStreamId $sourceContentStreamId,
public readonly UserId $initiatingUserId
) {
}

Expand All @@ -46,7 +45,6 @@ public static function fromArray(array $array): self
return new self(
ContentStreamId::fromString($array['contentStreamId']),
ContentStreamId::fromString($array['sourceContentStreamId']),
UserId::fromString($array['initiatingUserId'])
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\User\UserId;

/**
* Command to remove an existing content stream
Expand All @@ -27,7 +26,6 @@ final class RemoveContentStream implements CommandInterface
{
public function __construct(
public readonly ContentStreamId $contentStreamId,
public readonly UserId $initiatingUserId
) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
namespace Neos\ContentRepository\Core\Feature\NodeCreation\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
use Neos\ContentRepository\Core\SharedModel\User\UserId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;

/**
* CreateNodeAggregateWithNode
Expand Down Expand Up @@ -73,7 +72,6 @@ public function __construct(
* from the configured specializations.
*/
public readonly OriginDimensionSpacePoint $originDimensionSpacePoint,
public readonly UserId $initiatingUserId,
public readonly NodeAggregateId $parentNodeAggregateId,
?NodeAggregateId $succeedingSiblingNodeAggregateId = null,
?NodeName $nodeName = null,
Expand All @@ -94,7 +92,6 @@ public function withInitialPropertyValues(PropertyValuesToWrite $newInitialPrope
$this->nodeAggregateId,
$this->nodeTypeName,
$this->originDimensionSpacePoint,
$this->initiatingUserId,
$this->parentNodeAggregateId,
$this->succeedingSiblingNodeAggregateId,
$this->nodeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
namespace Neos\ContentRepository\Core\Feature\NodeCreation\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
use Neos\ContentRepository\Core\SharedModel\User\UserId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;

/**
* The properties of {@see CreateNodeAggregateWithNode} are directly serialized; and then this command
Expand Down Expand Up @@ -75,7 +74,6 @@ public function __construct(
* from the configured specializations.
*/
public readonly OriginDimensionSpacePoint $originDimensionSpacePoint,
public readonly UserId $initiatingUserId,
public readonly NodeAggregateId $parentNodeAggregateId,
?NodeAggregateId $succeedingSiblingNodeAggregateId = null,
?NodeName $nodeName = null,
Expand All @@ -99,7 +97,6 @@ public static function fromArray(array $array): self
NodeAggregateId::fromString($array['nodeAggregateId']),
NodeTypeName::fromString($array['nodeTypeName']),
OriginDimensionSpacePoint::fromArray($array['originDimensionSpacePoint']),
UserId::fromString($array['initiatingUserId']),
NodeAggregateId::fromString($array['parentNodeAggregateId']),
isset($array['succeedingSiblingNodeAggregateId'])
? NodeAggregateId::fromString($array['succeedingSiblingNodeAggregateId'])
Expand Down Expand Up @@ -131,7 +128,6 @@ public function withTetheredDescendantNodeAggregateIds(
$this->nodeAggregateId,
$this->nodeTypeName,
$this->originDimensionSpacePoint,
$this->initiatingUserId,
$this->parentNodeAggregateId,
$this->succeedingSiblingNodeAggregateId,
$this->nodeName,
Expand All @@ -145,18 +141,7 @@ public function withTetheredDescendantNodeAggregateIds(
*/
public function jsonSerialize(): array
{
return [
'contentStreamId' => $this->contentStreamId,
'nodeAggregateId' => $this->nodeAggregateId,
'nodeTypeName' => $this->nodeTypeName,
'originDimensionSpacePoint' => $this->originDimensionSpacePoint,
'initiatingUserId' => $this->initiatingUserId,
'parentNodeAggregateId' => $this->parentNodeAggregateId,
'succeedingSiblingNodeAggregateId' => $this->succeedingSiblingNodeAggregateId,
'nodeName' => $this->nodeName,
'initialPropertyValues' => $this->initialPropertyValues,
'tetheredDescendantNodeAggregateIds' => $this->tetheredDescendantNodeAggregateIds
];
return get_object_vars($this);
}

public function createCopyForContentStream(ContentStreamId $target): self
Expand All @@ -166,7 +151,6 @@ public function createCopyForContentStream(ContentStreamId $target): self
$this->nodeAggregateId,
$this->nodeTypeName,
$this->originDimensionSpacePoint,
$this->initiatingUserId,
$this->parentNodeAggregateId,
$this->succeedingSiblingNodeAggregateId,
$this->nodeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\SharedModel\User\UserId;

/**
* Disable the given node aggregate in the given content stream in a dimension space point using a given strategy
Expand All @@ -42,7 +41,6 @@ public function __construct(
public readonly DimensionSpacePoint $coveredDimensionSpacePoint,
/** The strategy the user chose to determine which specialization variants will also be disabled */
public readonly NodeVariantSelectionStrategy $nodeVariantSelectionStrategy,
public readonly UserId $initiatingUserId
) {
}

Expand All @@ -56,7 +54,6 @@ public static function fromArray(array $array): self
NodeAggregateId::fromString($array['nodeAggregateId']),
DimensionSpacePoint::fromArray($array['coveredDimensionSpacePoint']),
NodeVariantSelectionStrategy::from($array['nodeVariantSelectionStrategy']),
UserId::fromString($array['initiatingUserId'])
);
}

Expand All @@ -65,13 +62,7 @@ public static function fromArray(array $array): self
*/
public function jsonSerialize(): array
{
return [
'contentStreamId' => $this->contentStreamId,
'nodeAggregateId' => $this->nodeAggregateId,
'coveredDimensionSpacePoint' => $this->coveredDimensionSpacePoint,
'nodeVariantSelectionStrategy' => $this->nodeVariantSelectionStrategy,
'initiatingUserId' => $this->initiatingUserId
];
return get_object_vars($this);
}

public function createCopyForContentStream(ContentStreamId $target): self
Expand All @@ -81,7 +72,6 @@ public function createCopyForContentStream(ContentStreamId $target): self
$this->nodeAggregateId,
$this->coveredDimensionSpacePoint,
$this->nodeVariantSelectionStrategy,
$this->initiatingUserId
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\SharedModel\User\UserId;

/**
* Enable the given node aggregate in the given content stream in a dimension space point using a given strategy
Expand All @@ -42,7 +41,6 @@ public function __construct(
public readonly DimensionSpacePoint $coveredDimensionSpacePoint,
/** The strategy the user chose to determine which specialization variants will also be disabled */
public readonly NodeVariantSelectionStrategy $nodeVariantSelectionStrategy,
public readonly UserId $initiatingUserId
) {
}

Expand All @@ -56,7 +54,6 @@ public static function fromArray(array $array): self
NodeAggregateId::fromString($array['nodeAggregateId']),
DimensionSpacePoint::fromArray($array['coveredDimensionSpacePoint']),
NodeVariantSelectionStrategy::from($array['nodeVariantSelectionStrategy']),
UserId::fromString($array['initiatingUserId'])
);
}

Expand All @@ -65,13 +62,7 @@ public static function fromArray(array $array): self
*/
public function jsonSerialize(): array
{
return [
'contentStreamId' => $this->contentStreamId,
'nodeAggregateId' => $this->nodeAggregateId,
'coveredDimensionSpacePoint' => $this->coveredDimensionSpacePoint,
'nodeVariantSelectionStrategy' => $this->nodeVariantSelectionStrategy,
'initiatingUserId' => $this->initiatingUserId
];
return get_object_vars($this);
}

public function createCopyForContentStream(ContentStreamId $target): self
Expand All @@ -81,7 +72,6 @@ public function createCopyForContentStream(ContentStreamId $target): self
$this->nodeAggregateId,
$this->coveredDimensionSpacePoint,
$this->nodeVariantSelectionStrategy,
$this->initiatingUserId
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
namespace Neos\ContentRepository\Core\Feature\NodeDuplication\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\Feature\NodeDuplication\Dto\NodeAggregateIdMapping;
use Neos\ContentRepository\Core\Feature\NodeDuplication\Dto\NodeSubtreeSnapshot;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\ContentRepository\Core\SharedModel\User\UserId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;

/**
* CopyNodesRecursively command
Expand Down Expand Up @@ -62,7 +61,6 @@ private function __construct(
* @var OriginDimensionSpacePoint
*/
public readonly OriginDimensionSpacePoint $targetDimensionSpacePoint,
public readonly UserId $initiatingUserId,
/**
* Node aggregate id of the target node's parent (optional)
*
Expand Down Expand Up @@ -96,7 +94,6 @@ public static function createFromSubgraphAndStartNode(
ContentSubgraphInterface $subgraph,
Node $startNode,
OriginDimensionSpacePoint $dimensionSpacePoint,
UserId $initiatingUserId,
NodeAggregateId $targetParentNodeAggregateId,
?NodeAggregateId $targetSucceedingSiblingNodeAggregateId,
?NodeName $targetNodeName
Expand All @@ -107,7 +104,6 @@ public static function createFromSubgraphAndStartNode(
$startNode->subgraphIdentity->contentStreamId,
$nodeSubtreeSnapshot,
$dimensionSpacePoint,
$initiatingUserId,
$targetParentNodeAggregateId,
$targetSucceedingSiblingNodeAggregateId,
$targetNodeName,
Expand All @@ -124,7 +120,6 @@ public static function fromArray(array $array): self
ContentStreamId::fromString($array['contentStreamId']),
NodeSubtreeSnapshot::fromArray($array['nodeTreeToInsert']),
OriginDimensionSpacePoint::fromArray($array['targetDimensionSpacePoint']),
UserId::fromString($array['initiatingUserId']),
NodeAggregateId::fromString($array['targetParentNodeAggregateId']),
isset($array['targetSucceedingSiblingNodeAggregateId'])
? NodeAggregateId::fromString($array['targetSucceedingSiblingNodeAggregateId'])
Expand All @@ -139,16 +134,7 @@ public static function fromArray(array $array): self
*/
public function jsonSerialize(): array
{
return [
'contentStreamId' => $this->contentStreamId,
'nodeTreeToInsert' => $this->nodeTreeToInsert,
'targetDimensionSpacePoint' => $this->targetDimensionSpacePoint,
'initiatingUserId' => $this->initiatingUserId,
'targetParentNodeAggregateId' => $this->targetParentNodeAggregateId,
'targetSucceedingSiblingNodeAggregateId' => $this->targetSucceedingSiblingNodeAggregateId,
'targetNodeName' => $this->targetNodeName,
'nodeAggregateIdMapping' => $this->nodeAggregateIdMapping,
];
return get_object_vars($this);
}

public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool
Expand All @@ -170,7 +156,6 @@ public function createCopyForContentStream(ContentStreamId $target): self
$target,
$this->nodeTreeToInsert,
$this->targetDimensionSpacePoint,
$this->initiatingUserId,
$this->targetParentNodeAggregateId,
$this->targetSucceedingSiblingNodeAggregateId,
$this->targetNodeName,
Expand All @@ -185,7 +170,6 @@ public function withNodeAggregateIdMapping(
$this->contentStreamId,
$this->nodeTreeToInsert,
$this->targetDimensionSpacePoint,
$this->initiatingUserId,
$this->targetParentNodeAggregateId,
$this->targetSucceedingSiblingNodeAggregateId,
$this->targetNodeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
namespace Neos\ContentRepository\Core\Feature\NodeModification\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
use Neos\ContentRepository\Core\SharedModel\User\UserId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;

/**
* Set property values for a given node.
Expand All @@ -40,7 +38,6 @@ public function __construct(
public readonly NodeAggregateId $nodeAggregateId,
public readonly OriginDimensionSpacePoint $originDimensionSpacePoint,
public readonly PropertyValuesToWrite $propertyValues,
public readonly UserId $initiatingUserId
) {
}
}

0 comments on commit 4c9dd08

Please sign in to comment.