Commit 90416571 authored by Euan游根明's avatar Euan游根明

perf: 格式代码

parent 85b8aee0
...@@ -214,10 +214,7 @@ class Nacos ...@@ -214,10 +214,7 @@ class Nacos
if (!file_exists($path)) { if (!file_exists($path)) {
return ''; return '';
} }
$data = json_decode( $data = json_decode(file_get_contents($path), true);
file_get_contents($path),
true
);
if (empty($data)){ if (empty($data)){
return ''; return '';
} }
...@@ -236,10 +233,7 @@ class Nacos ...@@ -236,10 +233,7 @@ class Nacos
$data[$key] = $value; $data[$key] = $value;
return file_put_contents($path, json_encode($data)); return file_put_contents($path, json_encode($data));
} }
$data = json_decode( $data = json_decode(file_get_contents($path), true);
file_get_contents($path),
true
);
$data[$key] = $value; $data[$key] = $value;
return file_put_contents( return file_put_contents(
$path, $path,
...@@ -313,14 +307,8 @@ class Nacos ...@@ -313,14 +307,8 @@ class Nacos
$data[] = $logData; $data[] = $logData;
return file_put_contents($path, json_encode($data)); return file_put_contents($path, json_encode($data));
} }
$data = json_decode( $data = json_decode(file_get_contents($path), true);
file_get_contents($path),
true,
);
$data[] = $logData; $data[] = $logData;
return file_put_contents( return file_put_contents($path, json_encode($data));
$path,
json_encode($data),
);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment