Skip to content

Commit

Permalink
Rename and tweak PublishableInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed May 17, 2024
1 parent 85d2922 commit f4d2f41
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public static function enrichWithCommand(
foreach ($events as $event) {
if ($event instanceof DecoratedEvent) {
$undecoratedEvent = $event->innerEvent;
if (!$undecoratedEvent instanceof PublishableInterface) {
if (!$undecoratedEvent instanceof PublishableToWorkspaceInterface) {
throw new \RuntimeException(sprintf(
'TODO: Event %s has to implement PublishableToOtherContentStreamsInterface',
get_class($event)
));
}
} elseif (!$event instanceof PublishableInterface) {
} elseif (!$event instanceof PublishableToWorkspaceInterface) {
throw new \RuntimeException(sprintf(
'TODO: Event %s has to implement PublishableToOtherContentStreamsInterface',
get_class($event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
* on the target content stream, and no events have been committed to the target content stream in
* the meantime. This is because event's effects have to be fully deterministic.
*
* @internal used internally for the publishing mechanism of content streams
* @internal used internally for the publishing mechanism of workspaces
*/
interface PublishableInterface
interface PublishableToWorkspaceInterface
{
public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self;
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

Expand All @@ -33,7 +33,7 @@
*
* @api events are the persistence-API of the content repository
*/
final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableInterface
final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableToWorkspaceInterface
{
public function __construct(
public WorkspaceName $workspaceName,
Expand All @@ -43,11 +43,11 @@ public function __construct(
) {
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->source,
$this->target
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

Expand All @@ -29,7 +29,7 @@
*
* @api events are the persistence-API of the content repository
*/
final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableInterface
final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableToWorkspaceInterface
{
public function __construct(
public WorkspaceName $workspaceName,
Expand All @@ -39,11 +39,11 @@ public function __construct(
) {
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->source,
$this->target
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification;
Expand All @@ -35,7 +35,7 @@
*/
final readonly class NodeAggregateWithNodeWasCreated implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand Down Expand Up @@ -67,11 +67,11 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint
return $this->originDimensionSpacePoint;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->nodeTypeName,
$this->originDimensionSpacePoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand All @@ -31,7 +31,7 @@
*/
final readonly class NodeAggregateWasDisabled implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand All @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->nodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->affectedDimensionSpacePoints,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\EventStore\EventNormalizer;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand All @@ -32,7 +32,7 @@
*/
final readonly class NodeAggregateWasEnabled implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand All @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->nodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->affectedDimensionSpacePoints,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames;
Expand All @@ -38,7 +38,7 @@
*/
final readonly class NodePropertiesWereSet implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand Down Expand Up @@ -68,11 +68,11 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint
return $this->originDimensionSpacePoint;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->originDimensionSpacePoint,
$this->affectedDimensionSpacePoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSibling;
use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
Expand Down Expand Up @@ -51,7 +51,7 @@
*/
final readonly class NodeAggregateWasMoved implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand All @@ -73,11 +73,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->nodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->newParentNodeAggregateId,
$this->succeedingSiblingsForCoverage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName;
Expand All @@ -23,7 +23,7 @@
*/
final readonly class NodeReferencesWereSet implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand Down Expand Up @@ -58,11 +58,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->sourceNodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->sourceNodeAggregateId,
$this->affectedSourceOriginDimensionSpacePoints,
$this->referenceName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand All @@ -29,7 +29,7 @@
*/
final readonly class NodeAggregateWasRemoved implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand All @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->nodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new NodeAggregateWasRemoved(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->affectedOccupiedDimensionSpacePoints,
$this->affectedCoveredDimensionSpacePoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand All @@ -27,7 +27,7 @@
*/
final readonly class NodeAggregateNameWasChanged implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand All @@ -48,11 +48,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->nodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->newNodeName,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId;
use Neos\ContentRepository\Core\Feature\Common\PublishableInterface;
use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand All @@ -27,7 +27,7 @@
*/
final readonly class NodeAggregateTypeWasChanged implements
EventInterface,
PublishableInterface,
PublishableToWorkspaceInterface,
EmbedsContentStreamAndNodeAggregateId
{
public function __construct(
Expand All @@ -48,11 +48,11 @@ public function getNodeAggregateId(): NodeAggregateId
return $this->nodeAggregateId;
}

public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self
public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self
{
return new self(
$targetWorkspaceName,
$targetContentStreamId,
$contentStreamId,
$this->nodeAggregateId,
$this->newNodeTypeName
);
Expand Down
Loading

0 comments on commit f4d2f41

Please sign in to comment.