Conditions | 3 |
Paths | 3 |
Total Lines | 55 |
Code Lines | 40 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
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 |
||
26 | public function handle() |
||
27 | { |
||
28 | if (env('APP_ENV', 'production') != 'local') { |
||
|
|||
29 | $this->components->error("This app environment is not local"); |
||
30 | return; |
||
31 | } |
||
32 | |||
33 | if (env('MAGIC_INIT_LOCK', true) === true) { |
||
34 | $this->components->error("This action is blocked. MAGIC_INIT_LOCK is enabled by default"); |
||
35 | return; |
||
36 | } |
||
37 | |||
38 | $this->handleAppActionPath(); |
||
39 | $this->handleAppContractsPath(); |
||
40 | $this->handleAppEnumsPath(); |
||
41 | $this->handleAppEventsPath(); |
||
42 | $this->handleAppExceptionsPath(); |
||
43 | $this->handleAppFacadesPath(); |
||
44 | $this->handleAppHttpPath(); |
||
45 | $this->handleAppHttpControllersPath(); |
||
46 | $this->handleAppHttpControllersAuthPath(); |
||
47 | $this->handleAppHttpMiddlewarePath(); |
||
48 | $this->handleAppHttpRequestsPath(); |
||
49 | $this->handleAppHttpRequestsAuthPath(); |
||
50 | $this->handleAppListenersPath(); |
||
51 | $this->handleAppModelsPath(); |
||
52 | $this->handleAppModelsScopesPath(); |
||
53 | $this->handleAppNotificationsPath(); |
||
54 | $this->handleAppProvidersPath(); |
||
55 | $this->handleAppRepositoriesPath(); |
||
56 | $this->handleAppRulesPath(); |
||
57 | $this->handleAppServicesPath(); |
||
58 | $this->handleAppServicesAuthPath(); |
||
59 | $this->handleAppTraitsPath(); |
||
60 | |||
61 | $this->handleConfigPath(); |
||
62 | |||
63 | $this->handleDatabasePath(); |
||
64 | |||
65 | $this->handleLangPath(); |
||
66 | |||
67 | $this->handleRoutesPath(); |
||
68 | |||
69 | $this->handleTestsPath(); |
||
70 | |||
71 | $this->handleResourcesPath(); |
||
72 | |||
73 | $this->callSilently("vendor:publish", ["--provider" => "Laragear\TwoFactor\TwoFactorServiceProvider"]); |
||
74 | $this->components->info("Laragear TwoFactor migration and config file published"); |
||
75 | |||
76 | $this->callSilently("vendor:publish", ["--provider" => "Spatie\Activitylog\ActivitylogServiceProvider", "--tag" => "activitylog-migrations"]); |
||
77 | $this->components->info("Spatie ActivityLog migration and config file published"); |
||
78 | |||
79 | $this->callSilently("vendor:publish", ["--provider" => "Spatie\Permission\PermissionServiceProvider"]); |
||
80 | $this->components->info("Spatie Permissions migration and config file published"); |
||
81 | } |
||
83 |