| Conditions | 17 |
| Paths | 16384 |
| Total Lines | 63 |
| Code Lines | 38 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
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 |
||
| 27 | public function bootstrap($app) |
||
|
|
|||
| 28 | { |
||
| 29 | /* Config Translation */ |
||
| 30 | if (!isset($app->get('i18n')->translations['adminlte*'])) { |
||
| 31 | $app->get('i18n')->translations['adminlte*'] = [ |
||
| 32 | 'class' => PhpMessageSource::className(), |
||
| 33 | 'basePath' => __DIR__ . '/messages', |
||
| 34 | ]; |
||
| 35 | } |
||
| 36 | /* Config Theme */ |
||
| 37 | if (!isset($app->view->theme)) { |
||
| 38 | $app->view->theme = new \yii\base\Theme([ |
||
| 39 | 'pathMap' => [ |
||
| 40 | '@app/views/layouts' => '@cjtterabytesoft/adminlte/basic/views/layouts', |
||
| 41 | '@app/views/site' => '@cjtterabytesoft/adminlte/basic/views/site', |
||
| 42 | ], |
||
| 43 | ]); |
||
| 44 | } |
||
| 45 | /* Copy Avatar Images */ |
||
| 46 | if (\yii\helpers\BaseFileHelper::filterPath(\Yii::getAlias('@app/web/images'), $options = [])) { |
||
| 47 | \yii\helpers\BaseFileHelper::copyDirectory(\Yii::getAlias('@cjtterabytesoft/adminlte/basic/images/'), \Yii::getAlias('@app/web/images')); |
||
| 48 | } |
||
| 49 | /* Config Params */ |
||
| 50 | if (!isset($app->params['adminEmail'])) { |
||
| 51 | $app->params['adminEmail'] = '[email protected]'; |
||
| 52 | } |
||
| 53 | if (!isset($app->params['AdminLTESkin'])) { |
||
| 54 | $app->params['AdminLTESkin'] = 'skin-yellow'; |
||
| 55 | } |
||
| 56 | if (!isset($app->params['Author'])) { |
||
| 57 | $app->params['Author'] = '2015 - Wilmer Arambula'; |
||
| 58 | } |
||
| 59 | if (!isset($app->params['Facebook_Account'])) { |
||
| 60 | $app->params['Facebook_Account'] = 'https://www.facebook.com/username'; |
||
| 61 | } |
||
| 62 | if (!isset($app->params['Google_Account'])) { |
||
| 63 | $app->params['Google_Account'] = 'https://www.google.com/+username'; |
||
| 64 | } |
||
| 65 | if (!isset($app->params['Linkedin_Account'])) { |
||
| 66 | $app->params['Linkedin_Account'] = 'https://www.linkedin.com/in/username'; |
||
| 67 | } |
||
| 68 | if (!isset($app->params['Twitter_Account'])) { |
||
| 69 | $app->params['Twitter_Account'] = 'https://twitter.com/username'; |
||
| 70 | } |
||
| 71 | if (!isset($app->params['WebName'])) { |
||
| 72 | $app->params['WebName'] = 'My Application'; |
||
| 73 | } |
||
| 74 | if (!YII_ENV_TEST) { |
||
| 75 | if (!isset($app->params['imagesurl_30'])) { |
||
| 76 | $app->params['imagesurl_30'] = 'http://www.basic.tk/images/avatar/profile/30/icon-avatar.png'; |
||
| 77 | } |
||
| 78 | if (!isset($app->params['imagesurl_60'])) { |
||
| 79 | $app->params['imagesurl_60'] = 'http://www.basic.tk/images/avatar/profile/60/icon-avatar.png'; |
||
| 80 | } |
||
| 81 | } else { |
||
| 82 | if (!isset($app->params['imagesurl_30'])) { |
||
| 83 | $app->params['imagesurl_30'] = 'http://localhost.basic/images/avatar/profile/30/icon-avatar.png'; |
||
| 84 | } |
||
| 85 | if (!isset($app->params['imagesurl_60'])) { |
||
| 86 | $app->params['imagesurl_60'] = 'http://localhost.basic/images/avatar/profile/60/icon-avatar.png'; |
||
| 87 | } |
||
| 88 | } |
||
| 89 | } |
||
| 90 | } |