[TASK] Use a reference variable to pass $this into hooks