Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

Commit 5dc58b1

Browse files
committed
Fix coding style
1 parent dacf631 commit 5dc58b1

1 file changed

Lines changed: 38 additions & 34 deletions

File tree

bin/local-php-security-checker-installer

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,48 @@ if (!file_exists($bindir)) {
2525
mkdir($bindir, 0775, true);
2626
}
2727

28-
$platform = null;
29-
exec("uname", $platform_output);
28+
$platform = 'linux';
29+
$platform_output = null;
30+
exec('uname', $platform_output);
3031

31-
switch($platform_output[0]){
32-
case 'Darwin':
33-
$platform = 'darwin';
34-
break;
35-
case 'Linux':
36-
$platform = 'linux';
37-
break;
38-
case 'WindowsNT':
39-
$platform = 'windows';
40-
break;
41-
default:
42-
$platform = 'linux';
32+
if (isset($platform_output[0])) {
33+
switch ($platform_output[0]) {
34+
case 'Darwin':
35+
$platform = 'darwin';
36+
break;
37+
case 'Linux':
38+
$platform = 'linux';
39+
break;
40+
case 'WindowsNT':
41+
$platform = 'windows';
42+
break;
43+
default:
44+
}
4345
}
4446

45-
$architecture_ouput = null;
46-
exec("uname -m", $architecture_ouput);
47+
$architecture = 'amd64';
48+
$architecture_output = null;
49+
exec('uname -m', $architecture_output);
4750

48-
switch($architecture_ouput[0]){
49-
case 'arm':
50-
$architecture = 'arm64';
51-
break;
52-
case 'aarch64':
53-
$architecture = 'arm64';
54-
break;
55-
case 'i386':
56-
$architecture = '386';
57-
break;
58-
case 'i686':
59-
$architecture = '386';
60-
break;
61-
case 'x86_64':
62-
$architecture = 'amd64';
63-
break;
64-
default:
65-
$architecture = 'amd64';
51+
if (isset($architecture_output[0])) {
52+
switch ($architecture_output[0]) {
53+
case 'arm':
54+
$architecture = 'arm64';
55+
break;
56+
case 'aarch64':
57+
$architecture = 'arm64';
58+
break;
59+
case 'i386':
60+
$architecture = '386';
61+
break;
62+
case 'i686':
63+
$architecture = '386';
64+
break;
65+
case 'x86_64':
66+
$architecture = 'amd64';
67+
break;
68+
default:
69+
}
6670
}
6771

6872
exec("curl -LSs https://github.com/fabpot/local-php-security-checker/releases/download/v${version}/local-php-security-checker_${version}_${platform}_${architecture} > ./{$bindir}/local-php-security-checker");

0 commit comments

Comments
 (0)