-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TASK Refactor ContentContext methods #36
Conversation
70bd4c5
to
236e661
Compare
de418d4
to
6425df9
Compare
@@ -275,23 +279,22 @@ | |||
* ContentContext | |||
*/ | |||
// ContentContext::getCurrentSite | |||
// TODO: PHP | |||
$methodCallToWarningComments[] = new MethodCallToWarningComment(LegacyContextStub::class, 'getCurrentSite', '!! ContentContext::getCurrentSite() is removed in Neos 9.0.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What can we suggest here as replacement?
// ContentContext::getCurrentDomain | ||
// TODO: PHP | ||
// TODO: Fusion | ||
$methodCallToWarningComments[] = new MethodCallToWarningComment(LegacyContextStub::class, 'getCurrentDomain', '!! ContentContext::getCurrentDomain() is removed in Neos 9.0.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What can we suggest here as replacement?
// TODO: PHP | ||
// TODO: Fusion | ||
$methodCallToWarningComments[] = new MethodCallToWarningComment(LegacyContextStub::class, 'getCurrentDomain', '!! ContentContext::getCurrentDomain() is removed in Neos 9.0.'); | ||
$fusionNodePropertyPathToWarningComments[] = new FusionNodePropertyPathToWarningComment('context.currentDomain', 'Line %LINE: !! node.context.currentDomain is removed in Neos 9.0.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What can we suggest here as replacement?
// TODO: PHP | ||
// TODO: Fusion | ||
$methodCallToWarningComments[] = new MethodCallToWarningComment(LegacyContextStub::class, 'getCurrentSiteNode', '!! ContentContext::getCurrentSiteNode() is removed in Neos 9.0.'); | ||
$fusionNodePropertyPathToWarningComments[] = new FusionNodePropertyPathToWarningComment('context.currentSiteNode', 'Line %LINE: !! node.context.currentSiteNode is removed in Neos 9.0.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What can we suggest here as replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely an improvement.
# Conflicts: # config/set/contentrepository-90.php
This rector replaces removed ContentContext calls in PHP and Fusion. For better detection of context objects all Node(Interface)s get replaced by
Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub
. TheNeos\Rector\ContentRepository90\Legacy\NodeLegacyStub
get replaced at the end byNeos\ContentRepository\Core\Projection\ContentGraph\Node
PHP
ContentContext::isInBackend
=>$this->renderingModeService->findByCurrentUser()->isEdit
ContentContext::isLive
=>!$this->renderingModeService->findByCurrentUser()->isEdit && !$this->renderingModeService->findByCurrentUser()->isPreview
ContentContext::getCurrentRenderingMode
=>$this->renderingModeService->findByCurrentUser()
ContentContext::getCurrentSiteNode
=> Warning, no replacementContentContext::getCurrentDomain
=> Warning, no replacementContentContext::getCurrentSite
=> Warning, no replacementFusion
node.context.currentDomain
=> Warning, no replacementcontext.currentSiteNode
=> Warning, no replacementFixes #31