All preprocess methods have three arguments, regardless of the context of what the method is for. An example is:
protected function preprocessElement(Variables $variables, $hook, array $info) {}
This should really just be:
protected function preprocessElement(Element $element, Variables $variables) {}
Any helper method can access $variables, $hook, $info by attaching them to the object itself, regardless of the method signature, like:
$this->variables
$this->variables->element // if it exists
$this->hook
$this->info
Comments
Comment #2
markhalliwellComment #4
markhalliwell