File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -216,10 +216,10 @@ private function migrateFromV1_1(string $content): string
216
216
// Find messageType method and determine if it's SSE or HTTP
217
217
if (preg_match ('/(public function messageType\(\): ProcessMessageType\s*\{[^}]*\})/s ' , $ content , $ matches )) {
218
218
$ messageTypeMethod = $ matches [1 ];
219
-
219
+
220
220
// Check if the messageType returns SSE
221
221
$ isSSE = str_contains ($ messageTypeMethod , 'ProcessMessageType::SSE ' );
222
-
222
+
223
223
if ($ isSSE ) {
224
224
// For SSE tools: Replace messageType with isStreaming() returning true
225
225
$ isStreamingMethod = ' public function isStreaming(): bool ' .PHP_EOL .
@@ -230,13 +230,13 @@ private function migrateFromV1_1(string $content): string
230
230
} else {
231
231
// For HTTP tools: Just remove the messageType method completely
232
232
$ modifiedContent = str_replace ($ messageTypeMethod , '' , $ modifiedContent );
233
-
233
+
234
234
// Clean up any extra newlines left behind
235
235
$ modifiedContent = preg_replace ('/\n\s*\n\s*\n/ ' , "\n\n" , $ modifiedContent );
236
236
}
237
-
237
+
238
238
// Remove the ProcessMessageType import if it's no longer needed
239
- if (!$ isSSE && !str_contains ($ modifiedContent , 'ProcessMessageType:: ' )) {
239
+ if (! $ isSSE && ! str_contains ($ modifiedContent , 'ProcessMessageType:: ' )) {
240
240
$ modifiedContent = preg_replace ('/use OPGG \\\\LaravelMcpServer \\\\Enums \\\\ProcessMessageType;\s*\n/ ' , '' , $ modifiedContent );
241
241
}
242
242
}
You can’t perform that action at this time.
0 commit comments