Skip to content

Commit 9190db3

Browse files
committed
refactor: improve readability of absolute path management for MCPs
1 parent d332d8f commit 9190db3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/Console/InstallCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ private function installMcpServerConfig(): void
462462
)->toArray()
463463
);
464464

465+
/** @var CodeEnvironment $mcpClient */
465466
foreach ($this->selectedTargetMcpClient as $mcpClient) {
466467
$ideName = $mcpClient->mcpClientName();
467468
$ideDisplay = str_pad($ideName, $longestIdeName);
@@ -470,8 +471,7 @@ private function installMcpServerConfig(): void
470471

471472
if ($this->shouldInstallMcp()) {
472473
try {
473-
/** @phpstan-ignore property.notFound */
474-
$artisan = $mcpClient->absolute ? base_path('artisan') : './artisan';
474+
$artisan = $mcpClient->useAbsolutePathForMcp ? base_path('artisan') : './artisan';
475475
$result = $mcpClient->installMcp('laravel-boost', 'php', [$artisan, 'boost:mcp']);
476476

477477
if ($result) {

src/Install/CodeEnvironment/CodeEnvironment.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515

1616
abstract class CodeEnvironment
1717
{
18-
public bool $absolute = false;
18+
public bool $useAbsolutePathForMcp = false;
1919

20-
public function __construct(protected readonly DetectionStrategyFactory $strategyFactory)
21-
{
22-
}
20+
public function __construct(protected readonly DetectionStrategyFactory $strategyFactory) {}
2321

2422
abstract public function name(): string;
2523

src/Install/CodeEnvironment/PhpStorm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class PhpStorm extends CodeEnvironment implements Agent, McpClient
1212
{
13-
public bool $absolute = true;
13+
public bool $useAbsolutePathForMcp = true;
1414

1515
public function name(): string
1616
{

0 commit comments

Comments
 (0)