getCurrentRequest method should only be called when request is actually needed

Created on 25 March 2024, 9 months ago

Problem/Motivation

@mglaman pointed out the possible problem of these three patterns in the class constructor in his blog:
$this->request = $request_stack->getCurrentRequest();
$this->nodeStorage = $entity_type_manager->getStorage('node');
$this->config = $config_factory->get('mymodule.settings');

https://git.drupalcode.org/project/migrate_log_ui/-/blob/1.0.x/src/Contr...

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇸🇮Slovenia useernamee Ljubljana

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024