|
6 | 6 | use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
|
7 | 7 | use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface;
|
8 | 8 | use Neos\Neos\Domain\Service\RenderingModeService;
|
| 9 | +use Neos\Neos\Domain\Service\WorkspacePublishingService; |
| 10 | +use Neos\Neos\Domain\Service\WorkspaceService; |
9 | 11 | use Neos\Rector\ContentRepository90\Legacy\LegacyContextStub;
|
10 | 12 | use Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub;
|
11 | 13 | use Neos\Rector\ContentRepository90\Rules\ContentDimensionCombinatorGetAllAllowedCombinationsRector;
|
|
64 | 66 | use Neos\Rector\ContentRepository90\Rules\NodeTypeGetNameRector;
|
65 | 67 | use Neos\Rector\ContentRepository90\Rules\NodeTypeGetTypeOfAutoCreatedChildNodeRector;
|
66 | 68 | use Neos\Rector\ContentRepository90\Rules\NodeTypeManagerAccessRector;
|
| 69 | +use Neos\Rector\ContentRepository90\Rules\WorkspaceGetBaseWorkspaceRector; |
| 70 | +use Neos\Rector\ContentRepository90\Rules\WorkspaceGetBaseWorkspacesRector; |
| 71 | +use Neos\Rector\ContentRepository90\Rules\WorkspaceGetDescriptionRector; |
67 | 72 | use Neos\Rector\ContentRepository90\Rules\WorkspaceGetNameRector;
|
| 73 | +use Neos\Rector\ContentRepository90\Rules\WorkspaceGetTitleRector; |
| 74 | +use Neos\Rector\ContentRepository90\Rules\WorkspacePublishNodeRector; |
| 75 | +use Neos\Rector\ContentRepository90\Rules\WorkspacePublishRector; |
68 | 76 | use Neos\Rector\ContentRepository90\Rules\WorkspaceRepositoryCountByNameRector;
|
69 | 77 | use Neos\Rector\ContentRepository90\Rules\WorkspaceRepositoryFindByBaseWorkspaceRector;
|
70 | 78 | use Neos\Rector\ContentRepository90\Rules\WorkspaceRepositoryFindByIdentifierRector;
|
| 79 | +use Neos\Rector\ContentRepository90\Rules\WorkspaceSetDescriptionRector; |
| 80 | +use Neos\Rector\ContentRepository90\Rules\WorkspaceSetTitleRector; |
71 | 81 | use Neos\Rector\ContentRepository90\Rules\YamlDimensionConfigRector;
|
72 | 82 | use Neos\Rector\ContentRepository90\Rules\YamlRoutePartHandlerRector;
|
73 | 83 | use Neos\Rector\Generic\Rules\FusionFlowQueryNodePropertyToWarningCommentRector;
|
|
125 | 135 | \Neos\ContentRepository\Domain\Model\NodeType::class => \Neos\ContentRepository\Core\NodeType\NodeType::class,
|
126 | 136 | \Neos\ContentRepository\Domain\Service\NodeTypeManager::class => \Neos\ContentRepository\Core\NodeType\NodeTypeManager::class,
|
127 | 137 |
|
128 |
| - \Neos\ContentRepository\Domain\Model\Workspace::class => \Neos\ContentRepository\Core\Projection\Workspace\Workspace::class, |
| 138 | + \Neos\ContentRepository\Domain\Model\Workspace::class => \Neos\ContentRepository\Core\SharedModel\Workspace\Workspace::class, |
129 | 139 | \Neos\ContentRepository\Domain\NodeAggregate\NodeAggregateIdentifier::class => \Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId::class,
|
130 | 140 | \Neos\ContentRepository\Domain\NodeAggregate\NodeName::class => \Neos\ContentRepository\Core\SharedModel\Node\NodeName::class,
|
131 | 141 | \Neos\ContentRepository\Domain\NodeType\NodeTypeName::class => \Neos\ContentRepository\Core\NodeType\NodeTypeName::class,
|
|
702 | 712 | */
|
703 | 713 | $rectorConfig->rule(FusionFlowQueryContextRector::class);
|
704 | 714 |
|
| 715 | + /** |
| 716 | + * \Neos\ContentRepository\Domain\Model\Workspace |
| 717 | + */ |
| 718 | + // getBaseWorkspace(): Workspace|null |
| 719 | + $rectorConfig->rule(WorkspaceGetBaseWorkspaceRector::class); |
| 720 | + // getBaseWorkspaces(): Workspace[] |
| 721 | + $rectorConfig->rule(WorkspaceGetBaseWorkspacesRector::class); |
| 722 | + // getDescription(): null|string |
| 723 | + $rectorConfig->rule(WorkspaceGetDescriptionRector::class); |
| 724 | + // getName(): string |
| 725 | + // ->name |
| 726 | + // getNodeCount(): int |
| 727 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'getNodeCount', '!! Workspace::getNodeCount() has been removed in Neos 9.0 without a replacement.'); |
| 728 | + // getOwner(): UserInterface|null |
| 729 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'getOwner', '!! Workspace::getOwner() has been removed in Neos 9.0. Use WorkspaceService::getWorkspaceMetadata()->ownerUserId to get the userId of the owner.'); |
| 730 | + // getRootNodeData(): NodeData |
| 731 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'getRootNodeData', '!! Workspace::getRootNodeData() has been removed in Neos 9.0 without a replacement.'); |
| 732 | + // getTitle(): string |
| 733 | + $rectorConfig->rule(WorkspaceGetTitleRector::class); |
| 734 | + // meta->setWorkspaceTitle |
| 735 | + // isInternalWorkspace(): bool |
| 736 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'isInternalWorkspace', '!! Workspace::isInternalWorkspace() has been removed in Neos 9.0. Please use the new Workspace permission api instead. See ContentRepositoryAuthorizationService::getWorkspacePermissions()'); |
| 737 | + // isPersonalWorkspace(): bool |
| 738 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'isPersonalWorkspace', '!! Workspace::isPersonalWorkspace() has been removed in Neos 9.0. Please use the new Workspace permission api instead. See ContentRepositoryAuthorizationService::getWorkspacePermissions()'); |
| 739 | + // isPrivateWorkspace(): bool |
| 740 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'isPrivateWorkspace', '!! Workspace::isPrivateWorkspace() has been removed in Neos 9.0. Please use the new Workspace permission api instead. See ContentRepositoryAuthorizationService::getWorkspacePermissions()'); |
| 741 | + // isPublicWorkspace(): bool |
| 742 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'isPublicWorkspace', '!! Workspace::isPublicWorkspace() has been removed in Neos 9.0. Please use the new Workspace permission api instead. See ContentRepositoryAuthorizationService::getWorkspacePermissions()'); |
| 743 | + // publish(targetWorkspace: Workspace): void |
| 744 | + $rectorConfig->rule(WorkspacePublishRector::class); |
| 745 | + // publishNode(nodeToPublish: NodeInterface, targetWorkspace: Workspace): void |
| 746 | + $rectorConfig->rule(WorkspacePublishNodeRector::class); |
| 747 | + // publishNodes(nodes: NodeInterface[], targetWorkspace: Workspace): void |
| 748 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'publishNodes', '!! Workspace::publishNodes() has been removed in Neos 9.0. Use the \Neos\Neos\Domain\Service\WorkspacePublishingService to publish a workspace or changes in a document.'); |
| 749 | + // setBaseWorkspace(baseWorkspace: Workspace): void |
| 750 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'setBaseWorkspace', '!! Workspace::setBaseWorkspace() is not supported by the new CR. Use the "ChangeBaseWorkspace" command to change the baseWorkspace of a workspace.'); |
| 751 | + // setDescription(description: string): void |
| 752 | + $rectorConfig->rule(WorkspaceSetDescriptionRector::class); |
| 753 | + // setOwner(user: UserInterface|null|string): void |
| 754 | + $methodCallToWarningComments[] = new MethodCallToWarningComment(\Neos\ContentRepository\Domain\Model\Workspace::class, 'setOwner', '!! Workspace::setOwner() has been removed in Neos 9.0. You can set the owner of a workspace during creation WorkspaceService::createPersonalWorkspace().'); |
| 755 | + // setTitle(title: string): void |
| 756 | + $rectorConfig->rule(WorkspaceSetTitleRector::class); |
| 757 | + |
705 | 758 | /**
|
706 | 759 | * SPECIAL rules
|
707 | 760 | */
|
@@ -788,6 +841,8 @@ class_alias(RenameClassRector::class, \Alias\RenameClassRectorLegacy::class);
|
788 | 841 | new AddInjection('contentRepositoryRegistry', ContentRepositoryRegistry::class),
|
789 | 842 | new AddInjection('renderingModeService', RenderingModeService::class),
|
790 | 843 | new AddInjection('nodeLabelGenerator', NodeLabelGeneratorInterface::class),
|
| 844 | + new AddInjection('workspacePublishingService', WorkspacePublishingService::class), |
| 845 | + new AddInjection('workspaceService', WorkspaceService::class), |
791 | 846 | ]);
|
792 | 847 | // TODO: does not fully seem to work.$rectorConfig->rule(RemoveDuplicateCommentRector::class);
|
793 | 848 | };
|
0 commit comments