Skip to content

Commit

Permalink
Merge pull request #61 from neos/bugfix/followup-to-52
Browse files Browse the repository at this point in the history
BUGFIX: Fix error with rule configuration
  • Loading branch information
kdambekalns authored May 14, 2024
2 parents 192fbad + 5bc3f92 commit e105c8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions config/set/contentrepository-90.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use Neos\Rector\ContentRepository90\Rules\WorkspaceRepositoryCountByNameRector;
use Neos\Rector\ContentRepository90\Rules\YamlDimensionConfigRector;
use Neos\Rector\Generic\Rules\FusionNodePropertyPathToWarningCommentRector;
use Neos\Rector\Generic\Rules\FusionPrototypeNameAddCommentRector;
use Neos\Rector\Generic\Rules\InjectServiceIfNeededRector;
use Neos\Rector\Generic\Rules\MethodCallToWarningCommentRector;
use Neos\Rector\Generic\Rules\RemoveInjectionsRector;
Expand Down Expand Up @@ -117,10 +118,10 @@
]);


/** @var $methodCallToPropertyFetches MethodCallToPropertyFetch[] */
/** @var MethodCallToPropertyFetch[] $methodCallToPropertyFetches */
$methodCallToPropertyFetches = [];

/** @var $methodCallToWarningComments MethodCallToWarningComment[] */
/** @var MethodCallToWarningComment[] $methodCallToWarningComments */
$methodCallToWarningComments = [];


Expand Down Expand Up @@ -388,9 +389,9 @@
* Neos.Neos:PrimaryContent
* Neos.Fusion:Attributes
*/
$rectorConfig->ruleWithConfiguration(FusionPrototypeNameAddComment::class, [
new FusionPrototypeNameAddComment("Neos.Neos:PrimaryContent", 'TODO 9.0 migration: You need to refactor "Neos.Neos:PrimaryContent" to use "Neos.Neos:ContentCollection" instead.'),
new FusionPrototypeNameAddComment("Neos.Fusion:Attributes", 'TODO 9.0 migration: Neos.Fusion:Attributes has been removed without a replacement. You need to replace it by the property attributes in Neos.Fusion:Tag')
$rectorConfig->ruleWithConfiguration(FusionPrototypeNameAddCommentRector::class, [
new FusionPrototypeNameAddComment('Neos.Neos:PrimaryContent', 'TODO 9.0 migration: You need to refactor "Neos.Neos:PrimaryContent" to use "Neos.Neos:ContentCollection" instead.'),
new FusionPrototypeNameAddComment('Neos.Fusion:Attributes', 'TODO 9.0 migration: Neos.Fusion:Attributes has been removed without a replacement. You need to replace it by the property attributes in Neos.Fusion:Tag')
]);

/**
Expand Down
1 change: 1 addition & 0 deletions src/Generic/Rules/FusionPrototypeNameAddCommentRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function getRuleDefinition(): RuleDefinition

public function refactorFileContent(string $fileContent): string
{
$comments = [];
foreach ($this->fusionPrototypeNameAddComments as $fusionPrototypeNameAddComment) {
$matches = [];
$pattern = '/(^|[=\s\(<\/])(' .$fusionPrototypeNameAddComment->name. ')([\s\{\)\/>]|$)/';
Expand Down

0 comments on commit e105c8f

Please sign in to comment.