/
The assignment by reference refactoring [5.3.0-B1]

The assignment by reference refactoring [5.3.0-B1]

In-Portal was created when PHP 5 wasn't even in works and therefore usage of assignment by reference ("=&") constructs were quite popular. There were made several attempts to get rid of references and they indeed were successful:

  • the "$this->getObject()" method in "kDBTagProcessor"
  • the "$event->getObject()" method in "kDBEventHandler"
  • the "recallObject" method in "kApplication"
  • the "makeClass" method in "kApplication"

By looking at frequent method list, that were not transformed I've found following methods (there are others less frequently, if at all, used method and therefore I won't even mention them):

  • "UserHelper::getUserObject"
  • "kDBTagProcessor::GetList"

Solution

For "UserHelper::getUserObject" and "kDBTagProcessor::GetList" methods:

  1. change signature to remove "&"
  2. fix all usages to use "=" instead of "=&"

Related Tasks