Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
/**
* {@inheritdoc}
*/
public function render($hook, array $variables) {
return $this->theme($hook, $variables);
}
This adds one additional level of function nesting for absolute no win
Proposed resolution
Move the code from ::theme() to ::render()
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | 2531972-2.patch | 1.05 KB | dawehner |
Comments
Comment #1
dawehnerBetter title
Comment #2
dawehnerLet's just do that.
Its not nothing
Comment #3
Fabianx CreditAttribution: Fabianx as a volunteer commentedRTBC, that is indeed unnecessary indirection as small as it can be, it can add up.
Comment #4
dawehnerWell, one thing what this certainly improves is a little bit less noise in the profiling itself.
Comment #5
catchYes I really appreciate changes like this, makes it a lot easier to spot real problems rather than constantly trying to take red herrings into account.
Committed/pushed to 8.0.x, thanks!
Comment #7
Wim LeersOMG YAY!
@dawehner++
Comment #8
star-szrSorry, posting from my phone otherwise I'd grep but this might need a follow up to update docs pointing to the theme method.
Comment #9
star-szrNevermind, carry on :)