Skip to content

Commit b0a523a

Browse files
committed
fix: wip
2 parents 8582b6c + 2c1d879 commit b0a523a

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/Fields/Field.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
class Field extends OrganicField implements JsonSerializable
1919
{
20-
use Make;
21-
use HasAction;
2220
use FieldMcpSchemaDetection;
21+
use HasAction;
22+
use Make;
2323

2424
/**
2525
* The resource associated with the field.

src/Fields/FieldCollection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public function forMcpIndex(RestifyRequest $request, $repository): self
7373
if ($request instanceof McpRequest && method_exists($repository, 'fieldsForMcpIndex')) {
7474
// Get the MCP-specific fields from the repository
7575
$mcpFields = $repository->fieldsForMcpIndex($request);
76-
$mcpFieldAttributes = collect($mcpFields)->map(fn($field) => $field->attribute)->toArray();
77-
76+
$mcpFieldAttributes = collect($mcpFields)->map(fn ($field) => $field->attribute)->toArray();
77+
7878
// Filter the current collection to only include MCP fields
7979
return $this
8080
->filter(fn (Field $field) => ! $field instanceof EagerField)
@@ -83,7 +83,7 @@ public function forMcpIndex(RestifyRequest $request, $repository): self
8383
return $field->isShownOnMcp($request, $repository);
8484
})->values();
8585
}
86-
86+
8787
// Fallback to regular index filtering for non-MCP requests
8888
return $this->forIndex($request, $repository);
8989
}

tests/Fields/FieldMcpSchemaDetectionTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
namespace Binaryk\LaravelRestify\Tests\Fields;
44

5-
use Binaryk\LaravelRestify\Fields\BelongsTo;
65
use Binaryk\LaravelRestify\Fields\Field;
7-
use Binaryk\LaravelRestify\Fields\File;
8-
use Binaryk\LaravelRestify\Fields\HasMany;
9-
use Binaryk\LaravelRestify\MCP\Concerns\FieldMcpSchemaDetection;
106
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostRepository;
117
use Binaryk\LaravelRestify\Tests\IntegrationTestCase;
128
use Laravel\Mcp\Server\Tools\ToolInputSchema;
@@ -23,7 +19,7 @@ protected function tearDown(): void
2319
public function test_resolve_tool_schema_with_default_implementation(): void
2420
{
2521
$schema = Mockery::mock(ToolInputSchema::class);
26-
$repository = new PostRepository();
22+
$repository = new PostRepository;
2723

2824
$schema->shouldReceive('string')->with('title')->once()->andReturnSelf();
2925
$schema->shouldReceive('description')->with('Field: title (type: string). Examples: Sample Title, My Title')->once()->andReturnSelf();
@@ -37,7 +33,7 @@ public function test_resolve_tool_schema_with_default_implementation(): void
3733
public function test_resolve_tool_schema_with_required_field(): void
3834
{
3935
$schema = Mockery::mock(ToolInputSchema::class);
40-
$repository = new PostRepository();
36+
$repository = new PostRepository;
4137

4238
$schema->shouldReceive('string')->with('title')->once()->andReturnSelf();
4339
$schema->shouldReceive('description')->once()->andReturnSelf();
@@ -52,7 +48,7 @@ public function test_resolve_tool_schema_with_required_field(): void
5248
public function test_resolve_tool_schema_with_custom_callback(): void
5349
{
5450
$schema = Mockery::mock(ToolInputSchema::class);
55-
$repository = new PostRepository();
51+
$repository = new PostRepository;
5652
$callbackCalled = false;
5753

5854
$field = $this->createTestField('title');

tests/Fields/HasManyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function test_can_display_other_pages(): void
147147
public function test_can_apply_filters(): void
148148
{
149149
$this->markTestSkipped('Skipping filter test for PHP 8.2 + Laravel 11 prefer-lowest compatibility');
150-
150+
151151
tap($u = $this->mockUsers()->first(), function ($user) {
152152
tap($this->mockPosts($user->getKey(), 20), static function (Collection $posts) {
153153
$first = $posts->first();

0 commit comments

Comments
 (0)