格式化代码

This commit is contained in:
iVampireSP.com 2023-02-09 18:56:59 +08:00
parent f852717191
commit 876f3dff04
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
4 changed files with 28 additions and 29 deletions

View File

@ -118,7 +118,7 @@ private function handleOutgoingRequest(array $message): string
private function handleWeightUpdated(array $message): string private function handleWeightUpdated(array $message): string
{ {
$msg = ''; $msg = '';
if ($message['weight'] === "0") { if ($message['weight'] === '0') {
$msg .= '我不参与调度了。'; $msg .= '我不参与调度了。';
} else { } else {
$msg .= '我的权重是:'.$message['weight'].'。'; $msg .= '我的权重是:'.$message['weight'].'。';

View File

@ -24,7 +24,7 @@ class Work extends Command
*/ */
protected $description = '启动此应用程序。'; protected $description = '启动此应用程序。';
private string $weight = "1"; private string $weight = '1';
/** /**
* Execute the console command. * Execute the console command.

View File

@ -66,7 +66,7 @@ public static function updateThisNode($data = []): void
{ {
$node_id = config('settings.node.id'); $node_id = config('settings.node.id');
$node = self::hget('nodes', $node_id, "[]"); $node = self::hget('nodes', $node_id, '[]');
$node = json_decode($node, true); $node = json_decode($node, true);
$node = array_merge($node, $data); $node = array_merge($node, $data);
@ -74,7 +74,6 @@ public static function updateThisNode($data = []): void
ClusterSupport::hset('nodes', $node_id, $node); ClusterSupport::hset('nodes', $node_id, $node);
} }
public static function hset($key, $value, $data = []): void public static function hset($key, $value, $data = []): void
{ {
/** @noinspection PhpUndefinedMethodInspection */ /** @noinspection PhpUndefinedMethodInspection */
@ -85,7 +84,6 @@ public static function hset($key, $value, $data = []): void
* @param string|array $events 事件名称 * @param string|array $events 事件名称
* @param $callback callable 回调函数,接收一个参数,为事件数据。 * @param $callback callable 回调函数,接收一个参数,为事件数据。
* @param $ignore_self bool 是否忽略此节点的消息。 * @param $ignore_self bool 是否忽略此节点的消息。
*
* @return void * @return void
*/ */
public static function listen(string|array $events, callable $callback, bool $ignore_self = true): void public static function listen(string|array $events, callable $callback, bool $ignore_self = true): void

View File

@ -1,4 +1,5 @@
<?php <?php
namespace Deployer; namespace Deployer;
require 'recipe/laravel.php'; require 'recipe/laravel.php';