| Conditions | 1 |
| Paths | 1 |
| Total Lines | 60 |
| 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 |
||
| 122 | public function register() |
||
| 123 | { |
||
| 124 | // Register Configs |
||
| 125 | $this->mergeConfigFrom( |
||
| 126 | $this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'integrations.php'), |
||
| 127 | 'integrations' |
||
| 128 | ); |
||
| 129 | $this->mergeConfigFrom( |
||
| 130 | $this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'services.php'), |
||
| 131 | 'services' |
||
| 132 | ); |
||
| 133 | |||
| 134 | |||
| 135 | $this->setProviders(); |
||
| 136 | // $this->routes(); |
||
| 137 | |||
| 138 | |||
| 139 | |||
| 140 | // Register Migrations |
||
| 141 | $this->loadMigrationsFrom(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations'); |
||
| 142 | |||
| 143 | $this->app->singleton( |
||
| 144 | 'integrations', function () { |
||
| 145 | return new Integrations(); |
||
| 146 | } |
||
| 147 | ); |
||
| 148 | |||
| 149 | /* |
||
| 150 | |-------------------------------------------------------------------------- |
||
| 151 | | Register the Utilities |
||
| 152 | |-------------------------------------------------------------------------- |
||
| 153 | */ |
||
| 154 | /** |
||
| 155 | * Singleton Integrations; |
||
| 156 | */ |
||
| 157 | $this->app->singleton( |
||
| 158 | IntegrationsService::class, function ($app) { |
||
|
|
|||
| 159 | Log::channel('sitec-integrations')->info('Singleton Integrations;'); |
||
| 160 | return new IntegrationsService(\Illuminate\Support\Facades\Config::get('sitec.integrations')); |
||
| 161 | } |
||
| 162 | ); |
||
| 163 | |||
| 164 | // Register commands |
||
| 165 | $this->registerCommandFolders( |
||
| 166 | [ |
||
| 167 | base_path('vendor/sierratecnologia/integrations/src/Console/Commands') => '\Integrations\Console\Commands', |
||
| 168 | ] |
||
| 169 | ); |
||
| 170 | |||
| 171 | // /** |
||
| 172 | // * Helpers |
||
| 173 | // */ |
||
| 174 | // Aqui noa funciona |
||
| 175 | // if (!function_exists('integrations_asset')) { |
||
| 176 | // function integrations_asset($path, $secure = null) |
||
| 177 | // { |
||
| 178 | // return route('rica.integrations.assets').'?path='.urlencode($path); |
||
| 179 | // } |
||
| 180 | // } |
||
| 181 | } |
||
| 182 | |||
| 259 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.