Total Complexity | 5 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Coverage | 89.47% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait DetectsChromeVersion |
||
8 | { |
||
9 | /** |
||
10 | * The default commands to detect the installed Chrome/Chromium version. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $chromeCommands = [ |
||
15 | 'linux' => [ |
||
16 | '/usr/bin/google-chrome --version', |
||
17 | '/usr/bin/chromium-browser --version', |
||
18 | '/usr/bin/google-chrome-stable --version', |
||
19 | ], |
||
20 | 'mac' => [ |
||
21 | '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version', |
||
22 | ], |
||
23 | 'win' => [ |
||
24 | 'reg query "HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon" /v version', |
||
25 | ], |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Detect the installed Chrome/Chromium version. |
||
30 | * |
||
31 | * @param string $os |
||
32 | * @return int|bool |
||
33 | */ |
||
34 | 3 | protected function chromeVersion($os) |
|
73 |