Skip to content

Commit a374d23

Browse files
committed
fix phpstan errors
Signed-off-by: Pushpak Chhajed <[email protected]>
1 parent a8253ee commit a374d23

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Install/Mcp/FileWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ protected function hasUnquotedComments(string $content): bool
347347
if (preg_match_all($pattern, $content, $matches, PREG_SET_ORDER)) {
348348
foreach ($matches as $match) {
349349
// If group 2 is set, we found a // comment outside strings
350-
if (isset($match[2]) && ($match[2] !== '' && $match[2] !== '0')) {
350+
if (isset($match[2])) {
351351
return true;
352352
}
353353
}

src/Mcp/ToolExecutor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function reconstructResponse(array $data): Response
8585
if ($data['isError']) {
8686
$errorText = 'Unknown error';
8787

88-
if (is_array($data['content']) && (isset($data['content']) && $data['content'] !== [])) {
88+
if (is_array($data['content']) && $data['content'] !== []) {
8989
$firstContent = $data['content'][0] ?? [];
9090
if (is_array($firstContent)) {
9191
$errorText = $firstContent['text'] ?? $errorText;
@@ -96,7 +96,7 @@ protected function reconstructResponse(array $data): Response
9696
}
9797

9898
// Handle array format - extract text content
99-
if (is_array($data['content']) && (isset($data['content']) && $data['content'] !== [])) {
99+
if (is_array($data['content']) && $data['content'] !== []) {
100100
$firstContent = $data['content'][0] ?? [];
101101

102102
if (is_array($firstContent)) {

src/Mcp/Tools/DatabaseQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function handle(Request $request): Response
4343
{
4444
$query = trim((string) $request->string('query'));
4545
$token = strtok(ltrim($query), " \t\n\r");
46-
if ($token === '' || $token === '0' || $token === false) {
46+
if ($token === false) {
4747
return Response::error('Please pass a valid query');
4848
}
4949

0 commit comments

Comments
 (0)