| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | public function handle() |
||
| 27 | { |
||
| 28 | if (! $this->confirm('This command is only intended for a development environment and will change and create files in your project, do you want to continue?')) { |
||
| 29 | $this->error('cancelled'); |
||
| 30 | |||
| 31 | return; |
||
| 32 | } |
||
| 33 | $basePath = base_path(); |
||
| 34 | $this->line('Installing php cs fixer'); |
||
| 35 | exec("cd $basePath && composer require friendsofphp/php-cs-fixer"); |
||
| 36 | |||
| 37 | $source = __DIR__ . '/../../.php-cs-fixer.dist.php'; |
||
| 38 | exec("cp $source $basePath/.php-cs-fixer.dist.php"); |
||
| 39 | |||
| 40 | $this->line('Installing prettier and eslint'); |
||
| 41 | exec( |
||
| 42 | "cd $basePath && npm i --save-dev prettier eslint eslint-config-prettier" |
||
| 43 | ); |
||
| 44 | |||
| 45 | $source = __DIR__ . '/../../.prettierrc.yml'; |
||
| 46 | exec("cp $source $basePath/.prettierrc.yml"); |
||
| 47 | |||
| 48 | $source = __DIR__ . '/../../.eslintrc.js'; |
||
| 49 | exec("cp $source $basePath/.eslintrc.js"); |
||
| 50 | } |
||
| 52 |