Skip to content

Commit 688830d

Browse files
committed
Merge remote-tracking branch 'origin/1.x' into 1.x
2 parents 71bd728 + c95eadc commit 688830d

File tree

5 files changed

+35
-40
lines changed

5 files changed

+35
-40
lines changed

src/BoostServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BoostServiceProvider extends ServiceProvider
1212
public function register(): void
1313
{
1414
$this->mergeConfigFrom(
15-
__DIR__ . '/../config/boost.php', 'boost'
15+
__DIR__.'/../config/boost.php', 'boost'
1616
);
1717

1818
$this->app->singleton(Roster::class, function () {
@@ -53,7 +53,7 @@ protected function registerPublishing(): void
5353
{
5454
if ($this->app->runningInConsole()) {
5555
$this->publishes([
56-
__DIR__ . '/../config/boost.php' => config_path('boost.php'),
56+
__DIR__.'/../config/boost.php' => config_path('boost.php'),
5757
], 'boost-config');
5858
}
5959
}
@@ -63,7 +63,7 @@ protected function registerCommands(): void
6363
if ($this->app->runningInConsole()) {
6464
$this->commands([
6565
Console\StartCommand::class,
66-
Console\InstallCommand::class
66+
Console\InstallCommand::class,
6767
]);
6868
}
6969
}

src/Mcp/Tools/GetInertiaDoc.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Laravel\Boost\Mcp\Tools;
44

55
use Illuminate\Support\Facades\Cache;
6-
use Illuminate\Support\Facades\Log;
76
use Illuminate\Support\Str;
87
use Laravel\Boost\Concerns\MakesHttpRequests;
98
use Laravel\Mcp\Server\Tool;
@@ -19,13 +18,11 @@ class GetInertiaDoc extends Tool
1918
{
2019
use MakesHttpRequests;
2120

22-
public function __construct(protected Roster $roster)
23-
{
24-
}
21+
public function __construct(protected Roster $roster) {}
2522

2623
public function description(): string
2724
{
28-
return 'Fetch the contents of a single Inertia documentation file matching the installed major Inertia version.' . PHP_EOL .
25+
return 'Fetch the contents of a single Inertia documentation file matching the installed major Inertia version.'.PHP_EOL.
2926
'It\'s critical you use this and the list-inertia-docs tool to get the correct documentation for this application.';
3027
}
3128

@@ -39,7 +36,7 @@ public function schema(ToolInputSchema $schema): ToolInputSchema
3936
}
4037

4138
/**
42-
* @param array<string> $arguments
39+
* @param array<string> $arguments
4340
*/
4441
public function handle(array $arguments): ToolResult
4542
{
@@ -48,16 +45,16 @@ public function handle(array $arguments): ToolResult
4845
return ToolResult::error('The "filename" argument is required.');
4946
}
5047

51-
if (!Str::endsWith($filename, '.jsx')) {
48+
if (! Str::endsWith($filename, '.jsx')) {
5249
return ToolResult::error('The "filename" argument must end with ".jsx".');
5350
}
5451

55-
if (!preg_match('/^[a-z0-9-]+\.jsx$/', $filename)) {
52+
if (! preg_match('/^[a-z0-9-]+\.jsx$/', $filename)) {
5653
return ToolResult::error('The "filename" argument must be a valid filename (e.g. "installation.jsx").');
5754
}
5855

5956
[$ref, $shouldProceed] = $this->determineVersionRef();
60-
if (!$shouldProceed) {
57+
if (! $shouldProceed) {
6158
return ToolResult::error('Inertia is not installed in this project.');
6259
}
6360

@@ -70,14 +67,14 @@ public function handle(array $arguments): ToolResult
7067
/** @var \Illuminate\Http\Client\Response $response */
7168
$response = $this->client()->get($url);
7269

73-
if (!$response->successful()) {
74-
return ToolResult::error('Failed to fetch Inertia doc: ' . $response->body());
70+
if (! $response->successful()) {
71+
return ToolResult::error('Failed to fetch Inertia doc: '.$response->body());
7572
}
7673

7774
/** @var array<string,mixed> $data */
7875
$data = json_decode($response->body(), true, 512, JSON_THROW_ON_ERROR);
7976

80-
if (($data['type'] ?? '') !== 'file' || !isset($data['content'])) {
77+
if (($data['type'] ?? '') !== 'file' || ! isset($data['content'])) {
8178
return ToolResult::error('Unexpected response structure when fetching Inertia doc.');
8279
}
8380

@@ -118,7 +115,7 @@ private function determineVersionRef(): array
118115
return ['v1', false];
119116
}
120117

121-
return ['v' . $package->majorVersion(), true];
118+
return ['v'.$package->majorVersion(), true];
122119
}
123120

124121
public function shouldRegister(): bool

src/Mcp/Tools/GetLaravelDoc.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class GetLaravelDoc extends Tool
1919

2020
public function description(): string
2121
{
22-
return 'Fetch the contents of a single Laravel documentation file matching the currently installed major framework version.' . PHP_EOL .
22+
return 'Fetch the contents of a single Laravel documentation file matching the currently installed major framework version.'.PHP_EOL.
2323
'It\'s critical you use this and the list-laravel-docs tool to get the correct documentation for this application.';
2424
}
2525

@@ -33,7 +33,7 @@ public function schema(ToolInputSchema $schema): ToolInputSchema
3333
}
3434

3535
/**
36-
* @param array<string> $arguments
36+
* @param array<string> $arguments
3737
*/
3838
public function handle(array $arguments): ToolResult
3939
{
@@ -42,18 +42,18 @@ public function handle(array $arguments): ToolResult
4242
return ToolResult::error('The "filename" argument is required.');
4343
}
4444

45-
if (!Str::endsWith($filename, '.md')) {
45+
if (! Str::endsWith($filename, '.md')) {
4646
return ToolResult::error('The "filename" argument must end with ".md".');
4747
}
4848

49-
if (!preg_match('/^[a-z0-9-]+\.md$/', $filename)) {
49+
if (! preg_match('/^[a-z0-9-]+\.md$/', $filename)) {
5050
return ToolResult::error('The "filename" argument must be a valid filename (e.g. "installation.md").');
5151
}
5252

5353
// Determine the major version (e.g. 12.x)
5454
$version = Application::VERSION; // e.g. "12.6.0" or "12.x-dev"
5555
$major = Str::before($version, '.');
56-
$ref = $major . '.x';
56+
$ref = $major.'.x';
5757

5858
$cacheKey = "boost:mcp:laravel-doc:{$ref}:{$filename}";
5959

@@ -64,14 +64,14 @@ public function handle(array $arguments): ToolResult
6464
/** @var \Illuminate\Http\Client\Response $response */
6565
$response = $this->client()->get($url);
6666

67-
if (!$response->successful()) {
68-
return ToolResult::error('Failed to fetch Laravel doc: ' . $response->body());
67+
if (! $response->successful()) {
68+
return ToolResult::error('Failed to fetch Laravel doc: '.$response->body());
6969
}
7070

7171
/** @var array<string,mixed> $data */
7272
$data = json_decode($response->body(), true, 512, JSON_THROW_ON_ERROR);
7373

74-
if (($data['type'] ?? '') !== 'file' || !isset($data['content'])) {
74+
if (($data['type'] ?? '') !== 'file' || ! isset($data['content'])) {
7575
return ToolResult::error('Unexpected response structure when fetching Laravel doc.');
7676
}
7777

src/Mcp/Tools/ListInertiaDocs.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ class ListInertiaDocs extends Tool
1717
{
1818
use MakesHttpRequests;
1919

20-
public function __construct(protected Roster $roster)
21-
{
22-
}
20+
public function __construct(protected Roster $roster) {}
2321

2422
public function description(): string
2523
{
26-
return 'List all Inertia documentation files available for the installed major Inertia version.' . PHP_EOL .
24+
return 'List all Inertia documentation files available for the installed major Inertia version.'.PHP_EOL.
2725
'It\'s critical you use this and the get-inertia-doc tool to get the correct documentation for this application.';
2826
}
2927

@@ -34,12 +32,12 @@ public function schema(ToolInputSchema $schema): ToolInputSchema
3432
}
3533

3634
/**
37-
* @param array<string> $arguments
35+
* @param array<string> $arguments
3836
*/
3937
public function handle(array $arguments): ToolResult
4038
{
4139
[$ref, $shouldProceed] = $this->determineVersionRef();
42-
if (!$shouldProceed) {
40+
if (! $shouldProceed) {
4341
return ToolResult::error('Inertia is not installed in this project.');
4442
}
4543

@@ -52,15 +50,15 @@ public function handle(array $arguments): ToolResult
5250
/** @var \Illuminate\Http\Client\Response $response */
5351
$response = $this->client()->get($url);
5452

55-
if (!$response->successful()) {
56-
return ToolResult::error('Failed to fetch Inertia docs list: ' . $response->body());
53+
if (! $response->successful()) {
54+
return ToolResult::error('Failed to fetch Inertia docs list: '.$response->body());
5755
}
5856

5957
/** @var array<int,array<string,mixed>> $data */
6058
$data = json_decode($response->body(), true, 512, JSON_THROW_ON_ERROR);
6159

6260
return collect($data)
63-
->filter(fn($item) => ($item['type'] ?? '') === 'file')
61+
->filter(fn ($item) => ($item['type'] ?? '') === 'file')
6462
->pluck('name')
6563
->values()
6664
->all();
@@ -93,7 +91,7 @@ private function determineVersionRef(): array
9391
return ['v1', false];
9492
}
9593

96-
return ['v' . $package->majorVersion(), true];
94+
return ['v'.$package->majorVersion(), true];
9795
}
9896

9997
public function shouldRegister(): bool

src/Mcp/Tools/ListLaravelDocs.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ListLaravelDocs extends Tool
1919

2020
public function description(): string
2121
{
22-
return 'List all documentation files available for the currently installed major Laravel framework version.' . PHP_EOL .
22+
return 'List all documentation files available for the currently installed major Laravel framework version.'.PHP_EOL.
2323
'It\'s critical you use this and the get-laravel-doc tool to get the correct documentation for this application.';
2424
}
2525

@@ -30,14 +30,14 @@ public function schema(ToolInputSchema $schema): ToolInputSchema
3030
}
3131

3232
/**
33-
* @param array<string> $arguments
33+
* @param array<string> $arguments
3434
*/
3535
public function handle(array $arguments): ToolResult
3636
{
3737
// Determine the major version (e.g. 12.x)
3838
$version = Application::VERSION; // e.g. "12.6.0" or "12.x-dev"
3939
$major = Str::before($version, '.');
40-
$ref = $major . '.x';
40+
$ref = $major.'.x';
4141

4242
$cacheKey = "boost:mcp:laravel-docs-list:{$ref}";
4343

@@ -47,16 +47,16 @@ public function handle(array $arguments): ToolResult
4747
/** @var \Illuminate\Http\Client\Response $response */
4848
$response = $this->client()->get($url);
4949

50-
if (!$response->successful()) {
51-
return ToolResult::error('Failed to fetch Laravel docs list: ' . $response->body());
50+
if (! $response->successful()) {
51+
return ToolResult::error('Failed to fetch Laravel docs list: '.$response->body());
5252
}
5353

5454
/** @var array<int,array<string,mixed>> $data */
5555
$data = json_decode($response->body(), true, 512, JSON_THROW_ON_ERROR);
5656

5757
// Extract only file names (exclude directories)
5858
return collect($data)
59-
->filter(fn($item) => ($item['type'] ?? '') === 'file')
59+
->filter(fn ($item) => ($item['type'] ?? '') === 'file')
6060
->pluck('name')
6161
->values()
6262
->all();

0 commit comments

Comments
 (0)