Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI-1268: Suppress posix warnings #1714

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Helpers/LocalMachineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
* @param array|null $env
*/
private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE): Process {
if (function_exists('posix_isatty') && !posix_isatty(STDIN) && $stdin) {
if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if ((function_exists('posix_isatty') || !@posix_isatty(STDIN)) && $stdin) { $process->setInput(STDIN); } if ($cwd) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalNot": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if (function_exists('posix_isatty') && @posix_isatty(STDIN) && $stdin) { $process->setInput(STDIN); } if ($cwd) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if (function_exists('posix_isatty') && !@posix_isatty(STDIN) || $stdin) { $process->setInput(STDIN); } if ($cwd) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalAndAllSubExprNegation": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if (!function_exists('posix_isatty') && @posix_isatty(STDIN) && !$stdin) { $process->setInput(STDIN); } if ($cwd) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if (!function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { $process->setInput(STDIN); } if ($cwd) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalAndNegation": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if (!(function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin)) { $process->setInput(STDIN); } if ($cwd) {

Check warning on line 107 in src/Helpers/LocalMachineHelper.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": --- Original +++ New @@ @@ */ private function configureProcess(Process $process, string $cwd = NULL, ?bool $printOutput = TRUE, float $timeout = NULL, array $env = NULL, bool $stdin = TRUE) : Process { - if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && $stdin) { + if (function_exists('posix_isatty') && !@posix_isatty(STDIN) && !$stdin) { $process->setInput(STDIN); } if ($cwd) {
$process->setInput(STDIN);
}
if ($cwd) {
Expand Down Expand Up @@ -183,7 +183,7 @@
// of a tty if stdout is redirected.
// Otherwise, let the local machine helper decide whether to use a tty.
if (function_exists('posix_isatty')) {
return (posix_isatty(STDOUT) && posix_isatty(STDIN));
return (posix_isatty(STDOUT) && @posix_isatty(STDIN));

Check warning on line 186 in src/Helpers/LocalMachineHelper.php

View check run for this annotation

Codecov / codecov/patch

src/Helpers/LocalMachineHelper.php#L186

Added line #L186 was not covered by tests
}

return FALSE;
Expand Down