| Conditions | 1 |
| Paths | 1 |
| Total Lines | 54 |
| Code Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 80 | final protected function setUpSmarty() |
||
| 81 | { |
||
| 82 | $this->smarty = new Smarty(); |
||
| 83 | $pluginsDir = $this->getSiteConfiguration()->getFilePath() . '/smarty-plugins'; |
||
| 84 | |||
| 85 | // Dynamically load all plugins in the plugins directory |
||
| 86 | $this->loadPlugins($pluginsDir); |
||
| 87 | |||
| 88 | $this->assign('currentUser', User::getCommunity()); |
||
| 89 | $this->assign('skin', 'auto'); |
||
| 90 | $this->assign('currentDomain', null); |
||
| 91 | $this->assign('loggedIn', false); |
||
| 92 | $this->assign('baseurl', $this->getSiteConfiguration()->getBaseUrl()); |
||
| 93 | $this->assign('resourceCacheEpoch', $this->getSiteConfiguration()->getResourceCacheEpoch()); |
||
| 94 | $this->assign('serverPathInfo', WebRequest::pathInfo()); |
||
| 95 | |||
| 96 | $this->assign('siteNoticeText', ''); |
||
| 97 | $this->assign('siteNoticeVersion', 0); |
||
| 98 | $this->assign('siteNoticeState', 'd-none'); |
||
| 99 | $this->assign('toolversion', Environment::getToolVersion()); |
||
| 100 | |||
| 101 | // default these |
||
| 102 | $this->assign('onlineusers', array()); |
||
| 103 | $this->assign('typeAheadBlock', ''); |
||
| 104 | $this->assign('extraJs', array()); |
||
| 105 | |||
| 106 | // nav menu access control |
||
| 107 | $this->assign('nav__canRequests', false); |
||
| 108 | $this->assign('nav__canLogs', false); |
||
| 109 | $this->assign('nav__canUsers', false); |
||
| 110 | $this->assign('nav__canSearch', false); |
||
| 111 | $this->assign('nav__canStats', false); |
||
| 112 | $this->assign('nav__canBan', false); |
||
| 113 | $this->assign('nav__canEmailMgmt', false); |
||
| 114 | $this->assign('nav__canWelcomeMgmt', false); |
||
| 115 | $this->assign('nav__canSiteNoticeMgmt', false); |
||
| 116 | $this->assign('nav__canUserMgmt', false); |
||
| 117 | $this->assign('nav__canViewRequest', false); |
||
| 118 | $this->assign('nav__canJobQueue', false); |
||
| 119 | $this->assign('nav__canFlaggedComments', false); |
||
| 120 | $this->assign('nav__canDomainMgmt', false); |
||
| 121 | $this->assign('nav__canQueueMgmt', false); |
||
| 122 | $this->assign('nav__canFormMgmt', false); |
||
| 123 | $this->assign('nav__canErrorLog', false); |
||
| 124 | |||
| 125 | // Navigation badges for concern areas. |
||
| 126 | $this->assign("nav__numAdmin", 0); |
||
| 127 | $this->assign("nav__numFlaggedComments", 0); |
||
| 128 | $this->assign("nav__numJobQueueFailed", 0); |
||
| 129 | |||
| 130 | // debug helpers |
||
| 131 | $this->assign('showDebugCssBreakpoints', $this->getSiteConfiguration()->getDebuggingCssBreakpointsEnabled()); |
||
| 132 | |||
| 133 | $this->assign('page', $this); |
||
| 134 | } |
||
| 149 |