Skip to content

Commit

Permalink
TASK: Rename CommandInterface to PublicCommandInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 8, 2024
1 parent e9d576b commit fd1c8fc
Show file tree
Hide file tree
Showing 35 changed files with 73 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
/**
* @return EventsToPublish|\Generator<int, EventsToPublish>
*/
public function handle(CommandInterface|RebasableToOtherWorkspaceInterface $command): EventsToPublish|\Generator
public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): EventsToPublish|\Generator
{
// multiple handlers must not handle the same command
foreach ($this->handlers as $handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
interface CommandHandlerInterface
{
public function canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $command): bool;
public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool;

/**
* "simple" command handlers return EventsToPublish directly
Expand All @@ -26,5 +26,5 @@ public function canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $c
*
* @return EventsToPublish|\Generator<int, EventsToPublish>
*/
public function handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish|\Generator;
public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish|\Generator;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
*
* @internal sealed interface. Custom commands cannot be handled and are no extension point!
*/
interface CommandInterface
interface PublicCommandInterface
{
}
6 changes: 3 additions & 3 deletions Neos.ContentRepository.Core/Classes/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Neos\ContentRepository\Core;

use Neos\ContentRepository\Core\CommandHandler\CommandBus;
use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\Dimension\ContentDimensionSourceInterface;
use Neos\ContentRepository\Core\DimensionSpace\InterDimensionalVariationGraph;
use Neos\ContentRepository\Core\EventStore\EventNormalizer;
Expand Down Expand Up @@ -90,9 +90,9 @@ public function __construct(
/**
* The only API to send commands (mutation intentions) to the system.
*
* @param CommandInterface $command
* @param PublicCommandInterface $command
*/
public function handle(CommandInterface $command): void
public function handle(PublicCommandInterface $command): void
{
// the commands only calculate which events they want to have published, but do not do the
// publishing themselves
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
/**
* Common (marker) interface for all **commands** that need to be serialized for rebasing to other workspaces
*
* If the api command {@see CommandInterface} is serializable on its own it will directly implement this interface.
* If the api command {@see PublicCommandInterface} is serializable on its own it will directly implement this interface.
* For complex commands a serialized counterpart - which is not api - will be build which implements this interface.
*
* During a rebase, the command (either the original {@see CommandInterface} or its serialized counterpart) will be deserialized
* During a rebase, the command (either the original {@see PublicCommandInterface} or its serialized counterpart) will be deserialized
* from array {@see SerializedCommandInterface::fromArray()} and reapplied via the {@see CommandSimulator}
*
* Reminder: a rebase can fail, because the target content stream might contain conflicting changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
Expand All @@ -34,7 +34,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class AddDimensionShineThrough implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
RebasableToOtherWorkspaceInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* source code.
*/

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
Expand All @@ -30,7 +30,7 @@
*/
final readonly class MoveDimensionSpacePoint implements
\JsonSerializable,
CommandInterface,
PublicCommandInterface,
RebasableToOtherWorkspaceInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface;
use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies;
use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\DimensionSpace\ContentDimensionZookeeper;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
Expand Down Expand Up @@ -49,12 +49,12 @@ public function __construct(
) {
}

public function canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $command): bool
public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool
{
return method_exists($this, 'handle' . (new \ReflectionClass($command))->getShortName());
}

public function handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish
public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish
{
/** @phpstan-ignore-next-line */
return match ($command::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface;
use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies;
use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\DimensionSpace;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
Expand Down Expand Up @@ -87,12 +87,12 @@ public function __construct(
) {
}

public function canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $command): bool
public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool
{
return method_exists($this, 'handle' . (new \ReflectionClass($command))->getShortName());
}

public function handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish
public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish
{
/** @phpstan-ignore-next-line */
return match ($command::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeCreation\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
Expand All @@ -33,7 +33,7 @@
*
* @api commands are the write-API of the ContentRepository
*/
final readonly class CreateNodeAggregateWithNode implements CommandInterface
final readonly class CreateNodeAggregateWithNode implements PublicCommandInterface
{
/**
* @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeDisabling\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
Expand All @@ -30,7 +30,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class DisableNodeAggregate implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeDisabling\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
Expand All @@ -30,7 +30,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class EnableNodeAggregate implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeDuplication\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
Expand All @@ -38,7 +38,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class CopyNodesRecursively implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface;
use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies;
use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\DimensionSpace\ContentDimensionZookeeper;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
Expand Down Expand Up @@ -64,12 +64,12 @@ protected function getAllowedDimensionSubspace(): DimensionSpacePointSet
return $this->contentDimensionZookeeper->getAllowedDimensionSubspace();
}

public function canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $command): bool
public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool
{
return method_exists($this, 'handle' . (new \ReflectionClass($command))->getShortName());
}

public function handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish
public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish
{
/** @phpstan-ignore-next-line */
return match ($command::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeModification\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
Expand All @@ -34,7 +34,7 @@
*
* @api commands are the write-API of the ContentRepository
*/
final readonly class SetNodeProperties implements CommandInterface
final readonly class SetNodeProperties implements PublicCommandInterface
{
/**
* @param WorkspaceName $workspaceName The workspace in which the set properties operation is to be performed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeMove\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
Expand Down Expand Up @@ -43,7 +43,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class MoveNodeAggregate implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeReferencing\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\NodeReferencesToWrite;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
Expand All @@ -21,7 +21,7 @@
*
* @api commands are the write-API of the ContentRepository
*/
final readonly class SetNodeReferences implements CommandInterface
final readonly class SetNodeReferences implements PublicCommandInterface
{
/**
* @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeRemoval\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
Expand All @@ -27,7 +27,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class RemoveNodeAggregate implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeRenaming\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
Expand All @@ -32,7 +32,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class ChangeNodeAggregateName implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeTypeChange\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
Expand All @@ -29,7 +29,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class ChangeNodeAggregateType implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeVariation\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
Expand All @@ -30,7 +30,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class CreateNodeVariant implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
MatchableWithNodeIdToPublishOrDiscardInterface,
RebasableToOtherWorkspaceInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\RootNodeCreation\Command;

use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface;
use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
Expand All @@ -31,7 +31,7 @@
* @api commands are the write-API of the ContentRepository
*/
final readonly class CreateRootNodeAggregateWithNode implements
CommandInterface,
PublicCommandInterface,
\JsonSerializable,
RebasableToOtherWorkspaceInterface
{
Expand Down
Loading

0 comments on commit fd1c8fc

Please sign in to comment.