Replace some usages of &$this in hook parameters