| Conditions | 5 |
| Paths | 6 |
| Total Lines | 28 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5.3256 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 51 | 2 | public function handle() |
|
| 52 | { |
||
| 53 | 2 | $first = base_path('.env.example'); |
|
| 54 | 2 | $second = base_path('.env'); |
|
| 55 | |||
| 56 | 2 | if ($this->option('reverse')) { |
|
| 57 | $switch = $first; |
||
| 58 | $first = $second; |
||
| 59 | $second = $switch; |
||
| 60 | unset($switch); |
||
| 61 | } |
||
| 62 | |||
| 63 | 2 | $diffs = $this->sync->getDiff($first, $second); |
|
| 64 | |||
| 65 | 2 | if (count($diffs) === 0) { |
|
| 66 | 1 | $this->info(sprintf("Your %s file is already in sync with %s", basename($second), basename($first))); |
|
| 67 | 1 | return 0; |
|
| 68 | } |
||
| 69 | |||
| 70 | 1 | $this->info(sprintf("The following variables are not present in your %s file : ", basename($second))); |
|
| 71 | 1 | foreach ($diffs as $key => $diff) { |
|
| 72 | 1 | $this->info(sprintf("\t- %s = %s", $key, $diff)); |
|
| 73 | } |
||
| 74 | |||
| 75 | 1 | $this->info(sprintf("You can use `php artisan env:sync%s` to synchronise them", $this->option('reverse') ? ' --reverse' : '')); |
|
| 76 | |||
| 77 | 1 | return 1; |
|
| 78 | } |
||
| 79 | } |
||
| 80 |