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

formatting #735

Merged
merged 1 commit into from
Mar 25, 2022
Merged

formatting #735

merged 1 commit into from
Mar 25, 2022

Conversation

mowangjuanzi
Copy link
Contributor

According to phpstorm prompt

@@ -1462,9 +1459,6 @@ protected static function forkOneWorkerForLinux(self $worker)
{
// Get available worker id.
$id = static::getId($worker->workerId, 0);
if ($id === false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because $id's return type is int. so $id === false is never equal.

@@ -1373,7 +1370,7 @@ protected static function forkWorkersForWindows()
}
else
{
static::$globalEvent = new \Workerman\Events\Select();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because there is use at the top of the file

@@ -1047,7 +1044,7 @@ protected static function formatStatusData($statistics_file)
$total_timers = 0;
$maxLen1 = static::$_maxSocketNameLength;
$maxLen2 = static::$_maxWorkerNameLength;
foreach($info as $key => $value) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$key is not used.

@@ -1003,9 +1002,7 @@ protected static function parseCommand()
\posix_kill($master_pid, $sig);
exit;
default :
if (isset($command)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$command never is null. because line 886.

@@ -972,7 +971,7 @@ protected static function parseCommand()
$start_time = \time();
// Check master process is still alive?
while (1) {
$master_is_alive = $master_pid && \posix_kill((int) $master_pid, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$master_pid is already int

@walkor walkor merged commit 1528ef7 into walkor:master Mar 25, 2022
@walkor
Copy link
Owner

walkor commented Mar 25, 2022

Thanks.

@mowangjuanzi mowangjuanzi deleted the wk-1 branch March 25, 2022 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants