Skip to content

Commit 32a789c

Browse files
committed
Fix warning thrown when using phpcs on server with no shell_exec
1 parent b3c7925 commit 32a789c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Config.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ public function __set($name, $value)
219219
switch ($name) {
220220
case 'reportWidth' :
221221
// Support auto terminal width.
222-
if ($value === 'auto' && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1) {
222+
if ($value === 'auto'
223+
&& function_exists('shell_exec') === true
224+
&& preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1
225+
) {
223226
$value = (int) $matches[1];
224227
} else {
225228
$value = (int) $value;

0 commit comments

Comments
 (0)