Skip to content

Commit f9c8fc7

Browse files
committed
run code inspection check. fix some errors
1 parent 8d7f66c commit f9c8fc7

File tree

2 files changed

+48
-52
lines changed

2 files changed

+48
-52
lines changed

src/Signal.php

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,43 @@
1515
*/
1616
class Signal
1717
{
18-
const IGN = 1;
19-
const DFL = 0;
20-
const ERR = -1;
18+
public const IGN = 1;
19+
public const DFL = 0;
20+
public const ERR = -1;
2121

22-
const HUP = 1;
23-
const INT = 2; // Ctrl+C
24-
const QUIT = 3;
25-
const ILL = 4;
26-
const TRAP = 5;
27-
const ABRT = 6;
28-
const IOT = 6;
29-
const BUS = 7;
30-
const FPE = 8;
31-
const KILL = 9;
32-
const USR1 = 10;
33-
const SEGV = 11;
34-
const USR2 = 12;
35-
const PIPE = 13;
36-
const ALRM = 14;
37-
const TERM = 15;
38-
const STKFLT = 16;
39-
const CLD = 17;
40-
const CHLD = 17;
41-
const CONT = 18;
42-
const STOP = 19;
43-
const TSTP = 20;
44-
const TTIN = 21;
45-
const TTOU = 22;
46-
const URG = 23;
47-
const XCPU = 24;
48-
const XFSZ = 25;
49-
const VTALRM = 26;
50-
const PROF = 27;
51-
const WINCH = 28;
52-
const POLL = 29;
53-
const IO = 29;
54-
const PWR = 30;
55-
const SYS = 31;
56-
const BABY = 31;
22+
public const HUP = 1;
23+
public const INT = 2; // Ctrl+C
24+
public const QUIT = 3;
25+
public const ILL = 4;
26+
public const TRAP = 5;
27+
public const ABRT = 6;
28+
public const IOT = 6;
29+
public const BUS = 7;
30+
public const FPE = 8;
31+
public const KILL = 9;
32+
public const USR1 = 10;
33+
public const SEGV = 11;
34+
public const USR2 = 12;
35+
public const PIPE = 13;
36+
public const ALRM = 14;
37+
public const TERM = 15;
38+
public const STKFLT = 16;
39+
public const CLD = 17;
40+
public const CHLD = 17;
41+
public const CONT = 18;
42+
public const STOP = 19;
43+
public const TSTP = 20;
44+
public const TTIN = 21;
45+
public const TTOU = 22;
46+
public const URG = 23;
47+
public const XCPU = 24;
48+
public const XFSZ = 25;
49+
public const VTALRM = 26;
50+
public const PROF = 27;
51+
public const WINCH = 28;
52+
public const POLL = 29;
53+
public const IO = 29;
54+
public const PWR = 30;
55+
public const SYS = 31;
56+
public const BABY = 31;
5757
}

src/Sys.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static function execute($command, bool $returnStatus = true, string $cwd
103103
\chdir($cwd);
104104
}
105105

106-
//system
106+
// system
107107
if (\function_exists('system')) {
108108
\ob_start();
109109
\system($command, $exitStatus);
@@ -117,20 +117,16 @@ public static function execute($command, bool $returnStatus = true, string $cwd
117117
$output = \ob_get_contents();
118118
\ob_end_clean();
119119
//exec
120+
} elseif (\function_exists('exec')) {
121+
\exec($command, $output, $exitStatus);
122+
$output = \implode("\n", $output);
123+
124+
//shell_exec
125+
} elseif (\function_exists('shell_exec')) {
126+
$output = \shell_exec($command);
120127
} else {
121-
if (\function_exists('exec')) {
122-
\exec($command, $output, $exitStatus);
123-
$output = \implode("\n", $output);
124-
125-
//shell_exec
126-
} else {
127-
if (\function_exists('shell_exec')) {
128-
$output = \shell_exec($command);
129-
} else {
130-
$output = 'Command execution not possible on this system';
131-
$exitStatus = 0;
132-
}
133-
}
128+
$output = 'Command execution not possible on this system';
129+
$exitStatus = 0;
134130
}
135131

136132
if ($returnStatus) {

0 commit comments

Comments
 (0)