1 | <?php |
||||
2 | |||||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||||
3 | namespace Hhxsv5\LaravelS\Swoole\Process; |
||||
4 | |||||
5 | trait ProcessTitleTrait |
||||
0 ignored issues
–
show
|
|||||
6 | { |
||||
7 | public function setProcessTitle($title) |
||||
0 ignored issues
–
show
|
|||||
8 | { |
||||
9 | if (PHP_OS === 'Darwin') { |
||||
10 | return; |
||||
11 | } |
||||
12 | if (function_exists('cli_set_process_title')) { |
||||
13 | @cli_set_process_title($title); |
||||
0 ignored issues
–
show
It seems like you do not handle an error condition for
cli_set_process_title() . This can introduce security issues, and is generally not recommended.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
If you suppress an error, we recommend checking for the error condition explicitly: // For example instead of
@mkdir($dir);
// Better use
if (@mkdir($dir) === false) {
throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
![]() |
|||||
14 | } elseif (function_exists('swoole_set_process_name')) { |
||||
15 | @swoole_set_process_name($title); |
||||
0 ignored issues
–
show
It seems like you do not handle an error condition for
swoole_set_process_name() . This can introduce security issues, and is generally not recommended.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
If you suppress an error, we recommend checking for the error condition explicitly: // For example instead of
@mkdir($dir);
// Better use
if (@mkdir($dir) === false) {
throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
![]() |
|||||
16 | } |
||||
17 | } |
||||
18 | } |