Open   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 20
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 1
A openCmd() 0 4 2
1
<?php
2
3
namespace Nikaia\TranslationSheet\Commands;
4
5
use Illuminate\Console\Command;
6
use Nikaia\TranslationSheet\Spreadsheet;
7
8
class Open extends Command
9
{
10
    protected $signature = 'translation_sheet:open';
11
12
    protected $description = 'Open the spreadsheet in the browser';
13
14
    public function handle(Spreadsheet $spreadsheet)
15
    {
16
        $url = $spreadsheet->getUrl();
17
18
        $this->comment('Opening spreadsheet '.$url);
19
20
        shell_exec($this->openCmd().' '.$url);
21
    }
22
23
    protected function openCmd()
24
    {
25
        return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? 'start' : 'open';
26
    }
27
}
28