-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from neos/bugfix/configure-rules-once
BUGFIX: Configure each rule once, as multiple definitions just override the previous ones
- Loading branch information
Showing
3 changed files
with
58 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/Sets/ContentRepository90/Fixture/rename-node-interface-classes.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Neos\Rector\Test; | ||
|
||
use Neos\ContentRepository\Domain\Model\NodeInterface; | ||
use \Neos\ContentRepository\Domain\Model\Node; | ||
|
||
class SomeClass extends AnotherClass | ||
{ | ||
|
||
public function foo(Node $node, NodeInterface $targetNode) | ||
{ | ||
/** @var array<Node> $childNodes */ | ||
$childNodes = $node->getChildNodes(); | ||
|
||
$parent = $targetNode->getParent(); | ||
} | ||
|
||
} | ||
|
||
----- | ||
<?php | ||
|
||
namespace Neos\Rector\Test; | ||
|
||
use Neos\ContentRepository\Domain\Model\NodeInterface; | ||
use \Neos\ContentRepository\Domain\Model\Node; | ||
|
||
class SomeClass extends AnotherClass | ||
{ | ||
|
||
#[\Neos\Flow\Annotations\Inject] | ||
protected \Neos\ContentRepositoryRegistry\ContentRepositoryRegistry $contentRepositoryRegistry; | ||
public function foo(\Neos\ContentRepository\Core\Projection\ContentGraph\Node $node, \Neos\ContentRepository\Core\Projection\ContentGraph\Node $targetNode) | ||
{ | ||
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); | ||
// TODO 9.0 migration: Try to remove the iterator_to_array($nodes) call. | ||
|
||
/** @var array<\Neos\ContentRepository\Core\Projection\ContentGraph\Node> $childNodes */ | ||
$childNodes = iterator_to_array($subgraph->findChildNodes($node->nodeAggregateId, \Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter::create())); | ||
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($targetNode); | ||
|
||
$parent = $subgraph->findParentNode($targetNode->nodeAggregateId); | ||
} | ||
|
||
} | ||
|