| Conditions | 1 |
| Paths | 1 |
| Total Lines | 69 |
| Code Lines | 55 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 93 | protected function getLocalMethods() { |
||
| 94 | return [ |
||
| 95 | 'OC_L10N::get' => '8.2.0', |
||
| 96 | |||
| 97 | 'OCP\Activity\IManager::publishActivity' => '8.2.0', |
||
| 98 | |||
| 99 | 'OCP\App::register' => '8.1.0', |
||
| 100 | 'OCP\App::addNavigationEntry' => '8.1.0', |
||
| 101 | 'OCP\App::getActiveNavigationEntry' => '8.2.0', |
||
| 102 | 'OCP\App::setActiveNavigationEntry' => '8.1.0', |
||
| 103 | |||
| 104 | 'OCP\AppFramework\Controller::params' => '7.0.0', |
||
| 105 | 'OCP\AppFramework\Controller::getParams' => '7.0.0', |
||
| 106 | 'OCP\AppFramework\Controller::method' => '7.0.0', |
||
| 107 | 'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0', |
||
| 108 | 'OCP\AppFramework\Controller::env' => '7.0.0', |
||
| 109 | 'OCP\AppFramework\Controller::cookie' => '7.0.0', |
||
| 110 | 'OCP\AppFramework\Controller::render' => '7.0.0', |
||
| 111 | |||
| 112 | 'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0', |
||
| 113 | 'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0', |
||
| 114 | 'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0', |
||
| 115 | 'OCP\AppFramework\IAppContainer::log' => '8.0.0', |
||
| 116 | |||
| 117 | 'OCP\BackgroundJob::registerJob' => '8.1.0', |
||
| 118 | |||
| 119 | 'OCP\Files::tmpFile' => '8.1.0', |
||
| 120 | 'OCP\Files::tmpFolder' => '8.1.0', |
||
| 121 | |||
| 122 | 'OCP\IAppConfig::getValue' => '8.0.0', |
||
| 123 | 'OCP\IAppConfig::deleteKey' => '8.0.0', |
||
| 124 | 'OCP\IAppConfig::getKeys' => '8.0.0', |
||
| 125 | 'OCP\IAppConfig::setValue' => '8.0.0', |
||
| 126 | 'OCP\IAppConfig::deleteApp' => '8.0.0', |
||
| 127 | |||
| 128 | 'OCP\IDBConnection::createQueryBuilder' => '8.2.0', |
||
| 129 | 'OCP\IDBConnection::getExpressionBuilder' => '8.2.0', |
||
| 130 | |||
| 131 | 'OCP\ISearch::search' => '8.0.0', |
||
| 132 | |||
| 133 | 'OCP\IServerContainer::getCache' => '8.2.0', |
||
| 134 | 'OCP\IServerContainer::getDb' => '8.1.0', |
||
| 135 | 'OCP\IServerContainer::getHTTPHelper' => '8.1.0', |
||
| 136 | |||
| 137 | 'OCP\User::getUser' => '8.0.0', |
||
| 138 | 'OCP\User::getUsers' => '8.1.0', |
||
| 139 | 'OCP\User::getDisplayName' => '8.1.0', |
||
| 140 | 'OCP\User::getDisplayNames' => '8.1.0', |
||
| 141 | 'OCP\User::userExists' => '8.1.0', |
||
| 142 | 'OCP\User::logout' => '8.1.0', |
||
| 143 | 'OCP\User::checkPassword' => '8.1.0', |
||
| 144 | |||
| 145 | 'OCP\Util::encryptedFiles' => '8.1.0', |
||
| 146 | 'OCP\Util::formatDate' => '8.0.0', |
||
| 147 | 'OCP\Util::generateRandomBytes' => '8.1.0', |
||
| 148 | 'OCP\Util::getServerHost' => '8.1.0', |
||
| 149 | 'OCP\Util::getServerProtocol' => '8.1.0', |
||
| 150 | 'OCP\Util::getRequestUri' => '8.1.0', |
||
| 151 | 'OCP\Util::getScriptName' => '8.1.0', |
||
| 152 | 'OCP\Util::imagePath' => '8.1.0', |
||
| 153 | 'OCP\Util::isValidFileName' => '8.1.0', |
||
| 154 | 'OCP\Util::linkToRoute' => '8.1.0', |
||
| 155 | 'OCP\Util::linkTo' => '8.1.0', |
||
| 156 | 'OCP\Util::logException' => '8.2.0', |
||
| 157 | 'OCP\Util::mb_str_replace' => '8.2.0', |
||
| 158 | 'OCP\Util::mb_substr_replace' => '8.2.0', |
||
| 159 | 'OCP\Util::sendMail' => '8.1.0', |
||
| 160 | ]; |
||
| 161 | } |
||
| 162 | } |
||
| 163 |