Revert "fix: resolve PHPStan static analysis warnings"

This reverts commit 2d3e4b4a95.
This commit is contained in:
xboard
2025-04-14 21:23:08 +08:00
parent 2d3e4b4a95
commit db235c10e8
84 changed files with 1190 additions and 2330 deletions

View File

@@ -10,13 +10,12 @@ use App\Models\ServerGroup;
use App\Services\ServerService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class ManageController extends Controller
{
public function getNodes(Request $request)
{
$servers = ServerService::getAllServers()->map(function ($item) {
$servers = collect(ServerService::getAllServers())->map(function ($item) {
$item['groups'] = ServerGroup::whereIn('id', $item['group_ids'])->get(['name', 'id']);
$item['parent'] = $item->parent;
return $item;
@@ -42,7 +41,7 @@ class ManageController extends Controller
DB::commit();
} catch (\Exception $e) {
DB::rollBack();
Log::error($e);
\Log::error($e);
return $this->fail([500, '保存失败']);
}
@@ -61,7 +60,7 @@ class ManageController extends Controller
$server->update($params);
return $this->success(true);
} catch (\Exception $e) {
Log::error($e);
\Log::error($e);
return $this->fail([500, '保存失败']);
}
}
@@ -70,7 +69,7 @@ class ManageController extends Controller
Server::create($params);
return $this->success(true);
} catch (\Exception $e) {
Log::error($e);
\Log::error($e);
return $this->fail([500, '创建失败']);
}
@@ -84,7 +83,7 @@ class ManageController extends Controller
'show' => 'integer',
]);
if (!Server::where('id', $request->id)->update(['show' => $request->show])) {
if (Server::where('id', $request->id)->update(['show' => $request->show]) === false) {
return $this->fail([500, '保存失败']);
}
return $this->success(true);