Skip to content

Commit 391ad01

Browse files
committed
refactor: update McpInstallationStrategy casing to align with consistent enum naming convention
- Renamed enum cases in `McpInstallationStrategy` to uppercase for standardization. - Updated references across codebase and adjusted related test cases.
1 parent a616134 commit 391ad01

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/Install/CodeEnvironment/ClaudeCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function projectDetectionConfig(): array
4343

4444
public function mcpInstallationStrategy(): McpInstallationStrategy
4545
{
46-
return McpInstallationStrategy::Shell;
46+
return McpInstallationStrategy::SHELL;
4747
}
4848

4949
public function shellMcpCommand(): string

src/Install/CodeEnvironment/CodeEnvironment.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function isMcpClient(): bool
7676

7777
public function mcpInstallationStrategy(): McpInstallationStrategy
7878
{
79-
return McpInstallationStrategy::File;
79+
return McpInstallationStrategy::FILE;
8080
}
8181

8282
public function shellMcpCommand(): ?string
@@ -113,9 +113,9 @@ public function mcpConfigKey(): string
113113
public function installMcp(string $key, string $command, array $args = [], array $env = []): bool
114114
{
115115
return match($this->mcpInstallationStrategy()) {
116-
McpInstallationStrategy::Shell => $this->installShellMcp($key, $command, $args, $env),
117-
McpInstallationStrategy::File => $this->installFileMcp($key, $command, $args, $env),
118-
McpInstallationStrategy::None => false
116+
McpInstallationStrategy::SHELL => $this->installShellMcp($key, $command, $args, $env),
117+
McpInstallationStrategy::FILE => $this->installFileMcp($key, $command, $args, $env),
118+
McpInstallationStrategy::NONE => false
119119
};
120120
}
121121

src/Install/Enums/McpInstallationStrategy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
enum McpInstallationStrategy: string
88
{
9-
case Shell = 'shell';
10-
case File = 'file';
11-
case None = 'none';
9+
case SHELL = 'shell';
10+
case FILE = 'file';
11+
case NONE = 'none';
1212
}

tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function mcpConfigPath(): string
161161
test('mcpInstallationStrategy returns File by default', function () {
162162
$environment = new TestCodeEnvironment($this->strategyFactory);
163163

164-
expect($environment->mcpInstallationStrategy())->toBe(McpInstallationStrategy::File);
164+
expect($environment->mcpInstallationStrategy())->toBe(McpInstallationStrategy::FILE);
165165
});
166166

167167
test('shellMcpCommand returns null by default', function () {
@@ -193,7 +193,7 @@ public function mcpConfigPath(): string
193193
$environment->shouldAllowMockingProtectedMethods();
194194

195195
$environment->shouldReceive('mcpInstallationStrategy')
196-
->andReturn(McpInstallationStrategy::Shell);
196+
->andReturn(McpInstallationStrategy::SHELL);
197197

198198
$environment->shouldReceive('installShellMcp')
199199
->once()
@@ -210,7 +210,7 @@ public function mcpConfigPath(): string
210210
$environment->shouldAllowMockingProtectedMethods();
211211

212212
$environment->shouldReceive('mcpInstallationStrategy')
213-
->andReturn(McpInstallationStrategy::File);
213+
->andReturn(McpInstallationStrategy::FILE);
214214

215215
$environment->shouldReceive('installFileMcp')
216216
->once()
@@ -226,7 +226,7 @@ public function mcpConfigPath(): string
226226
$environment = Mockery::mock(TestCodeEnvironment::class)->makePartial();
227227

228228
$environment->shouldReceive('mcpInstallationStrategy')
229-
->andReturn(McpInstallationStrategy::None);
229+
->andReturn(McpInstallationStrategy::NONE);
230230

231231
$result = $environment->installMcp('test-key', 'test-command');
232232

@@ -249,7 +249,7 @@ public function mcpConfigPath(): string
249249
->andReturn('install {key} {command} {args} {env}');
250250

251251
$environment->shouldReceive('mcpInstallationStrategy')
252-
->andReturn(McpInstallationStrategy::Shell);
252+
->andReturn(McpInstallationStrategy::SHELL);
253253

254254
$mockResult = Mockery::mock();
255255
$mockResult->shouldReceive('successful')->andReturn(true);
@@ -277,7 +277,7 @@ public function mcpConfigPath(): string
277277
->andReturn('install {key}');
278278

279279
$environment->shouldReceive('mcpInstallationStrategy')
280-
->andReturn(McpInstallationStrategy::Shell);
280+
->andReturn(McpInstallationStrategy::SHELL);
281281

282282
$mockResult = Mockery::mock();
283283
$mockResult->shouldReceive('successful')->andReturn(false);
@@ -305,7 +305,7 @@ public function mcpConfigPath(): string
305305
$environment->shouldAllowMockingProtectedMethods();
306306

307307
$environment->shouldReceive('mcpInstallationStrategy')
308-
->andReturn(McpInstallationStrategy::File);
308+
->andReturn(McpInstallationStrategy::FILE);
309309

310310
File::shouldReceive('ensureDirectoryExists')
311311
->once()
@@ -331,7 +331,7 @@ public function mcpConfigPath(): string
331331
$environment->shouldAllowMockingProtectedMethods();
332332

333333
$environment->shouldReceive('mcpInstallationStrategy')
334-
->andReturn(McpInstallationStrategy::File);
334+
->andReturn(McpInstallationStrategy::FILE);
335335

336336
$existingConfig = json_encode(['mcpServers' => ['existing' => ['command' => 'existing-cmd']]]);
337337

0 commit comments

Comments
 (0)