Skip to content
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: Avoid accessing "global" request, response and arguments in action controller #4

Conversation

mhsdesign
Copy link

for neos#3232

@@ -560,12 +560,12 @@ protected function callActionMethod(ActionRequest $request, ActionResponse $resp
}

if ($actionResult === null && $this->view instanceof ViewInterface) {
$this->response = $this->renderView($this->response);
$response = $this->renderView($response);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this assignment on $this->response was a thorn in my eyes

@@ -260,8 +260,7 @@ public function processRequest(ActionRequest $request): ActionResponse
$this->initializeView($this->view);
}

// We still use a global response here as it might have been changed in any of the steps above
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if someone dared to replace $this->response above - not just mutate the object!!! - i dont know what i should think.

@mhsdesign mhsdesign force-pushed the task/actioncontroller-simplecontroller-review-2 branch from c956b23 to 44f5356 Compare January 29, 2024 23:16
@mhsdesign
Copy link
Author

I extracted the standalone parts into own prs like neos#3292 so this might actually be merged directly into your feature branch, without to big of a diff.

@mhsdesign mhsdesign force-pushed the task/actioncontroller-simplecontroller-review-2 branch from 44f5356 to 03f7367 Compare January 30, 2024 12:50
@mhsdesign mhsdesign changed the title Task/actioncontroller simplecontroller review 2 TASK: Avoid accessing "global" request, response and arguments in action controller Jan 30, 2024
@github-actions github-actions bot added the Task label Jan 30, 2024
@mhsdesign mhsdesign force-pushed the task/actioncontroller-simplecontroller-review-2 branch from 03f7367 to d9b881d Compare February 3, 2024 15:46
@mhsdesign mhsdesign closed this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant