Conditions | 12 |
Paths | 257 |
Total Lines | 48 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
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 |
||
28 | public function handle() |
||
29 | { |
||
30 | $this->line('=== Install LarrockCMS ==='); |
||
31 | |||
32 | if(env('DB_DATABASE') === 'homestead' || env('DB_USERNAME') === 'homestead' || env('DB_PASSWORD') === 'secret') { |
||
33 | $this->line('Параметры подключения к БД в .env-файле:'); |
||
34 | $this->line('DB_DATABASE=' . env('DB_DATABASE')); |
||
35 | $this->line('DB_USERNAME=' . env('DB_USERNAME')); |
||
36 | $this->line('DB_PASSWORD=' . env('DB_PASSWORD')); |
||
37 | if ( !$this->confirm('Данные для доступа к БД верны?')) { |
||
38 | $this->error('Установка завершена некорректно. Пожалуйста, установите правильные данные для доступа к БД и повторите попытку'); |
||
39 | return FALSE; |
||
40 | } |
||
41 | } |
||
42 | |||
43 | if ($this->confirm('Шаг 1/7. Обновить .env? (larrock:updateEnv)')) { |
||
44 | $this->call('larrock:updateEnv'); |
||
45 | } |
||
46 | |||
47 | if ($this->confirm('Шаг 2/7. Сменить директорию "public" на "public_html"? (larrock:renamePublicDirectory)')) { |
||
48 | $this->call('larrock:renamePublicDirectory'); |
||
49 | } |
||
50 | |||
51 | if ($this->confirm('Шаг 3/7. Обновить конфиги зависимостей? (larrock:updateVendorConfig)')) { |
||
52 | $this->call('larrock:updateVendorConfig'); |
||
53 | } |
||
54 | |||
55 | if ($this->confirm('Шаг 4/7. Опубликовать ресурсы (vendor:publish)?')) { |
||
56 | $this->call('vendor:publish'); |
||
57 | } |
||
58 | |||
59 | if ($this->confirm('Шаг 5/7. Выполнить миграции БД (migrate)?')) { |
||
60 | $this->call('migrate'); |
||
61 | } |
||
62 | |||
63 | if ($this->confirm('Шаг 6/7. Добавить пользователя администратора? (larrock:addAdmin)')) { |
||
64 | $this->call('larrock:addAdmin'); |
||
65 | } |
||
66 | |||
67 | if ($this->confirm('Шаг 7/7. Установить пакеты ресурсов для шаблонов? (larrock:assets)')) { |
||
68 | $this->call('larrock:assets'); |
||
69 | } |
||
70 | |||
71 | //$this->call('larrock:check'); |
||
72 | $this->info('=== Install LarrockCMS successfully ended ==='); |
||
73 | $this->info('Проверка корректности установки LarrockCMS - php artisan larrock:check'); |
||
74 | $this->info('Если вы хотите установить пакеты не входящие в ядро LarrockCMS, выполните команду php artisan larrock:manager'); |
||
75 | } |
||
76 | } |