Skip to content

Commit

Permalink
TASK: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubitz committed Nov 21, 2024
1 parent 319d32e commit 863726a
Showing 1 changed file with 100 additions and 6 deletions.
106 changes: 100 additions & 6 deletions docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 61 Rules Overview
# 64 Rules Overview

## ContentDimensionCombinatorGetAllAllowedCombinationsRector

Expand Down Expand Up @@ -1359,7 +1359,7 @@ return static function (RectorConfig $rectorConfig): void {

## NodeGetContextGetWorkspaceNameRector

`"NodeInterface::getContext()::getWorkspace()"` will be rewritten
`"NodeInterface::getContext()::getWorkspaceName()"` will be rewritten

- class: [`Neos\Rector\ContentRepository90\Rules\NodeGetContextGetWorkspaceNameRector`](../src/ContentRepository90/Rules/NodeGetContextGetWorkspaceNameRector.php)

Expand Down Expand Up @@ -1409,6 +1409,31 @@ return static function (RectorConfig $rectorConfig): void {

<br>

## NodeGetContextPathRector

`"NodeInterface::getContextPath()"` will be rewritten

- class: [`Neos\Rector\ContentRepository90\Rules\NodeGetContextPathRector`](../src/ContentRepository90/Rules/NodeGetContextPathRector.php)

```diff
<?php

use Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub;

class SomeClass
{
public function run(NodeLegacyStub $node)
{
- return $node->getContextPath();
+ return \Neos\ContentRepository\Core\SharedModel\Node\NodeAddress::fromNode($node)->toJson();
}
}

?>
```

<br>

## NodeGetDepthRector

`"NodeInterface::getDepth()"` will be rewritten
Expand Down Expand Up @@ -1437,7 +1462,7 @@ return static function (RectorConfig $rectorConfig): void {

## NodeGetDimensionsRector

`"NodeInterface::getChildNodes()"` will be rewritten
`"NodeInterface::getDimensions()"` will be rewritten

- class: [`Neos\Rector\ContentRepository90\Rules\NodeGetDimensionsRector`](../src/ContentRepository90/Rules/NodeGetDimensionsRector.php)

Expand All @@ -1462,6 +1487,51 @@ return static function (RectorConfig $rectorConfig): void {

<br>

## NodeGetHiddenBeforeAfterDateTimeRector

`"NodeInterface::getHiddenBeforeDateTime()",` `"NodeInterface::setHiddenBeforeDateTime()",` `"NodeInterface::getHiddenAfterDateTime()"` and `"NodeInterface::setHiddenAfterDateTime()"` will be rewritten

- class: [`Neos\Rector\ContentRepository90\Rules\NodeGetHiddenBeforeAfterDateTimeRector`](../src/ContentRepository90/Rules/NodeGetHiddenBeforeAfterDateTimeRector.php)

```diff
<?php

use Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub;

class SomeClass
{
public function nodeHiddenBeforeDateTime(NodeLegacyStub $node)
{
- $dateTime = $node->getHiddenBeforeDateTime();
+ // TODO 9.0 migration: Timed publishing has been conceptually changed and has been extracted into a dedicated package. Please check https://github.com/neos/timeable-node-visibility for further details.

+ $dateTime = $node->getProperty('enableAfterDateTime');
+ // TODO 9.0 migration: Timed publishing has been conceptually changed and has been extracted into a dedicated package. Please check https://github.com/neos/timeable-node-visibility for further details.
+ // Use the "SetNodeProperties" command to change property values for "enableAfterDateTime" or "disableAfterDateTime".
+
+
$node->setHiddenBeforeDateTime($dateTime);
}

public function nodeHiddenAfterDateTime(NodeLegacyStub $node)
{
- $dateTime = $node->getHiddenAfterDateTime();
+ // TODO 9.0 migration: Timed publishing has been conceptually changed and has been extracted into a dedicated package. Please check https://github.com/neos/timeable-node-visibility for further details.
+
+ $dateTime = $node->getProperty('disableAfterDateTime');
+ // TODO 9.0 migration: Timed publishing has been conceptually changed and has been extracted into a dedicated package. Please check https://github.com/neos/timeable-node-visibility for further details.
+ // Use the "SetNodeProperties" command to change property values for "enableAfterDateTime" or "disableAfterDateTime".
+

$node->setHiddenAfterDateTime($dateTime);
}
}

?>
```

<br>

## NodeGetIdentifierRector

`"NodeInterface::getIdentifier()"` will be rewritten
Expand Down Expand Up @@ -1533,8 +1603,7 @@ return static function (RectorConfig $rectorConfig): void {
public function run(NodeLegacyStub $node)
{
- $nodeType = $node->getNodeType();
+ // TODO 9.0 migration: Make this code aware of multiple Content Repositories.
+ $contentRepository = $this->contentRepositoryRegistry->get(\Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId::fromString('default'));
+ $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId);
+ $nodeType = $contentRepository->getNodeTypeManager()->getNodeType($node->nodeTypeName);
}
}
Expand Down Expand Up @@ -1623,6 +1692,31 @@ return static function (RectorConfig $rectorConfig): void {

<br>

## NodeIsAutoCreatedRector

"NodeInterface::isAutoCreated" will be rewritten

- class: [`Neos\Rector\ContentRepository90\Rules\NodeIsAutoCreatedRector`](../src/ContentRepository90/Rules/NodeIsAutoCreatedRector.php)

```diff
<?php

use Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub;

class SomeClass
{
public function run(NodeLegacyStub $node)
{
- $bool = $node->isAutoCreated();
+ $bool = $node->classification->isTethered();
}
}

?>
```

<br>

## NodeIsHiddenInIndexRector

`"NodeInterface::isHiddenInIndex()"` will be rewritten
Expand Down Expand Up @@ -1808,7 +1902,7 @@ return static function (RectorConfig $rectorConfig): void {
$nodeName = NodeName::fromString('name');
$nodeType = $node->getNodeType();
- $type = $nodeType->getTypeOfAutoCreatedChildNode($nodeName);
+ // TODO 9.0 migration: Make this code aware of multiple Content Repositories.
+ // TODO 9.0 migration: Make this code aware of multiple Content Repositories. If you have a Node object around you can use $node->contentRepositoryId.
+ $contentRepository = $this->contentRepositoryRegistry->get(\Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId::fromString('default'));
+ $type = $contentRepository->getNodeTypeManager()->getNodeType($nodeType->tetheredNodeTypeDefinitions->get($nodeName));
}
Expand Down

0 comments on commit 863726a

Please sign in to comment.