Skip to content

Commit 1f899a8

Browse files
committed
refactor: filewriter: less magic numbers
1 parent dc2146e commit 1f899a8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Install/Mcp/FileWriter.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class FileWriter
1515

1616
protected array $serversToAdd = [];
1717

18+
protected int $defaultIndentation = 8;
19+
1820
public function __construct(string $filePath)
1921
{
2022
$this->filePath = $filePath;
@@ -28,8 +30,8 @@ public function configKey(string $key): self
2830
}
2931

3032
/**
31-
* Add a new MCP server to the configuration while preserving JSON5 formatting.
32-
*
33+
* @param string $key MCP Server Name
34+
* @param string $command
3335
* @param array<int, string> $args
3436
* @param array<string, string> $env
3537
*/
@@ -313,7 +315,7 @@ public function detectIndentation(string $content, int $nearPosition): int
313315
}
314316

315317
// Fallback: assume 8 spaces (2 levels of 4-space indentation typical for JSON)
316-
return 8;
318+
return $this->defaultIndentation;
317319
}
318320

319321
/**

0 commit comments

Comments
 (0)