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