| Conditions | 1 |
| Paths | 1 |
| Total 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 |
||
| 100 | public function register() |
||
| 101 | { |
||
| 102 | $this->mergeConfigFrom($this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'sitec'.DIRECTORY_SEPARATOR.'transmissor.php'), 'sitec.transmissor'); |
||
| 103 | |||
| 104 | |||
| 105 | $this->setProviders(); |
||
| 106 | |||
| 107 | // $kernel = $this->app->make(Kernel::class); |
||
| 108 | // $kernel->pushMiddleware(TransmissorCallbacks::class); |
||
| 109 | |||
| 110 | |||
| 111 | // Register Migrations |
||
| 112 | $this->loadMigrationsFrom(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations'); |
||
| 113 | |||
| 114 | $this->app->singleton( |
||
| 115 | 'transmissor', |
||
| 116 | function () { |
||
| 117 | return new Transmissor(); |
||
| 118 | } |
||
| 119 | ); |
||
| 120 | |||
| 121 | /* |
||
| 122 | |-------------------------------------------------------------------------- |
||
| 123 | | Register the Utilities |
||
| 124 | |-------------------------------------------------------------------------- |
||
| 125 | */ |
||
| 126 | /** |
||
| 127 | * Singleton Transmissor; |
||
| 128 | */ |
||
| 129 | $this->app->singleton( |
||
| 130 | TransmissorService::class, |
||
| 131 | function ($app) { |
||
|
|
|||
| 132 | Log::channel('sitec-transmissor')->info('Singleton Transmissor;'); |
||
| 133 | return new TransmissorService(\Illuminate\Support\Facades\Config::get('sitec.transmissor')); |
||
| 134 | } |
||
| 135 | ); |
||
| 136 | |||
| 137 | // Register commands |
||
| 138 | $this->registerCommandFolders( |
||
| 139 | [ |
||
| 140 | base_path('vendor/sierratecnologia/transmissor/src/Console/Commands') => '\Transmissor\Console\Commands', |
||
| 141 | ] |
||
| 142 | ); |
||
| 143 | |||
| 144 | // /** |
||
| 145 | // * Helpers |
||
| 146 | // */ |
||
| 147 | // Aqui noa funciona |
||
| 148 | // if (!function_exists('transmissor_asset')) { |
||
| 149 | // function transmissor_asset($path, $secure = null) |
||
| 150 | // { |
||
| 151 | // return route('rica.transmissor.assets').'?path='.urlencode($path); |
||
| 152 | // } |
||
| 153 | // } |
||
| 154 | } |
||
| 155 | |||
| 236 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.