CMTV
Well-known member
Hi!
I wonder why there are so many functions like the one below in XenForo's code?
Why not simply writing something like that:
It is shorted and cleaner...
I can understand that sometimes we need repo in multiply places within the same class but is
I wonder why there are so many functions like the one below in XenForo's code?
PHP:
/**
* @return \XF\Repository\Trophy
*/
protected function getTrophyRepo()
{
return $this->repository('XF:Trophy');
}
Why not simply writing something like that:
PHP:
/** @var \XF\Repository\Trophy $trophyRepo */
$trophyRepo = $this->repository('XF:Trophy');
It is shorted and cleaner...
I can understand that sometimes we need repo in multiply places within the same class but is
$this->repository(...)
operation is so consuming? Why not calling it twice?