Line 41 assigns the params object to $params.
Line 51 accesses $this->params which was never assigned.
It doesn't seem to matter much if the variable is local or a class property (although having access to it in the template might be useful) but it should be one or the other.