Skip to content

Commit 06446e9

Browse files
luisdalmolingithub-actions[bot]
authored andcommitted
Fix styling
1 parent 2d68dd8 commit 06446e9

13 files changed

+37
-41
lines changed

src/DescribeFilamentResourceTool.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function extractRelationshipsInfo(Resource $resource): array
115115
// Placeholder: Use manager class name as key.
116116
$relationName = $manager->getRelationshipName();
117117
$modelClass = $resource::getModel();
118-
$modelInstance = new $modelClass();
118+
$modelInstance = new $modelClass;
119119
$relation = $modelInstance->$relationName();
120120

121121
$relationships[$relationName] = [
@@ -163,8 +163,8 @@ public function makeFilamentTranslatableContentDriver(): ?TranslatableContentDri
163163
'type' => 'searchable_column',
164164
'example' => [
165165
'description' => 'Use string value to search within this column',
166-
'values' => ['search term', 'partial match']
167-
]
166+
'values' => ['search term', 'partial match'],
167+
],
168168
])
169169
->keyBy('name')
170170
->all();
@@ -291,7 +291,7 @@ public function mapTableFilter(BaseFilter $filter): array
291291
$baseInfo['example'] = [
292292
'description' => 'Use true for yes, false for no, null for all',
293293
'values' => [true, false, null],
294-
'usage' => "Include as '{$filter->getName()}': true|false|null in your filters JSON"
294+
'usage' => "Include as '{$filter->getName()}': true|false|null in your filters JSON",
295295
];
296296
} elseif ($filter instanceof SelectFilter) {
297297
$baseInfo['optionsSource'] = 'Dynamic/Callable';
@@ -305,24 +305,24 @@ public function mapTableFilter(BaseFilter $filter): array
305305
'description' => 'Use array of option keys or single option key',
306306
'values' => [
307307
'single' => $exampleSingle,
308-
'multiple' => $exampleMultiple
308+
'multiple' => $exampleMultiple,
309309
],
310-
'usage' => "Include as '{$filter->getName()}': [" . implode(', ', array_map(fn($v) => "\"$v\"", $exampleMultiple)) . "] or '{$filter->getName()}': \"$exampleSingle\" in your filters JSON"
310+
'usage' => "Include as '{$filter->getName()}': [".implode(', ', array_map(fn ($v) => "\"$v\"", $exampleMultiple))."] or '{$filter->getName()}': \"$exampleSingle\" in your filters JSON",
311311
];
312312
} else {
313313
$baseInfo['example'] = [
314314
'description' => 'Use array of option values or single option value',
315315
'values' => [
316316
'single' => 'option_value',
317-
'multiple' => ['option_value_1', 'option_value_2']
317+
'multiple' => ['option_value_1', 'option_value_2'],
318318
],
319-
'usage' => "Include as '{$filter->getName()}': [\"option_value_1\", \"option_value_2\"] or '{$filter->getName()}': \"option_value\" in your filters JSON"
319+
'usage' => "Include as '{$filter->getName()}': [\"option_value_1\", \"option_value_2\"] or '{$filter->getName()}': \"option_value\" in your filters JSON",
320320
];
321321
}
322322
} else {
323323
$baseInfo['example'] = [
324324
'description' => 'Custom filter - check filter implementation for expected values',
325-
'usage' => "Include as '{$filter->getName()}': value in your filters JSON"
325+
'usage' => "Include as '{$filter->getName()}': value in your filters JSON",
326326
];
327327
}
328328

tests/Feature/DescribeFilamentResourceToolTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
use Tests\Feature\TestUserResource;
3+
use Kirschbaum\Loop\Filament\DescribeFilamentResourceTool;
44
use Tests\Feature\TestPostWithRelationsResource;
5+
use Tests\Feature\TestUserResource;
56
use Tests\Feature\TestUserWithRelationsResource;
6-
use Kirschbaum\Loop\Filament\DescribeFilamentResourceTool;
77

88
it('can instantiate the describe filament resource tool', function () {
9-
$tool = new DescribeFilamentResourceTool();
9+
$tool = new DescribeFilamentResourceTool;
1010

1111
expect($tool)->toBeInstanceOf(DescribeFilamentResourceTool::class);
1212
expect($tool->getName())->toBe('describe_filament_resource');
1313
});
1414

1515
it('can extract table schema using the tool', function () {
16-
$tool = new DescribeFilamentResourceTool();
16+
$tool = new DescribeFilamentResourceTool;
1717
$resource = app(TestUserResource::class);
1818

1919
$tableSchema = $tool->extractTableSchema($resource);
@@ -28,7 +28,7 @@
2828
});
2929

3030
it('can extract column properties through the tool', function () {
31-
$tool = new DescribeFilamentResourceTool();
31+
$tool = new DescribeFilamentResourceTool;
3232
$resource = app(TestUserResource::class);
3333

3434
$tableSchema = $tool->extractTableSchema($resource);
@@ -46,7 +46,7 @@
4646
});
4747

4848
it('can extract bulk actions through the tool', function () {
49-
$tool = new DescribeFilamentResourceTool();
49+
$tool = new DescribeFilamentResourceTool;
5050
$resource = app(TestUserResource::class);
5151

5252
$tableSchema = $tool->extractTableSchema($resource);
@@ -57,7 +57,7 @@
5757
});
5858

5959
it('can extract resource relationships through the tool', function () {
60-
$tool = new DescribeFilamentResourceTool();
60+
$tool = new DescribeFilamentResourceTool;
6161
$resource = app(TestUserWithRelationsResource::class);
6262

6363
$relationships = $tool->extractRelationshipsInfo($resource);
@@ -75,7 +75,7 @@
7575
});
7676

7777
it('can describe a complete resource using the tool', function () {
78-
$tool = new DescribeFilamentResourceTool();
78+
$tool = new DescribeFilamentResourceTool;
7979

8080
$result = $tool->describe(TestUserWithRelationsResource::class);
8181

@@ -95,7 +95,7 @@
9595
});
9696

9797
it('can extract different relationship types including belongsTo', function () {
98-
$tool = new DescribeFilamentResourceTool();
98+
$tool = new DescribeFilamentResourceTool;
9999
$resource = app(TestPostWithRelationsResource::class);
100100

101101
$relationships = $tool->extractRelationshipsInfo($resource);
@@ -113,7 +113,7 @@
113113
});
114114

115115
it('can describe a resource with mixed relationship types', function () {
116-
$tool = new DescribeFilamentResourceTool();
116+
$tool = new DescribeFilamentResourceTool;
117117

118118
$result = $tool->describe(TestPostWithRelationsResource::class);
119119

@@ -127,4 +127,4 @@
127127
expect($relationships)->toHaveKeys(['comments', 'category'])
128128
->and($relationships['comments']['type'])->toBe('HasMany')
129129
->and($relationships['category']['type'])->toBe('BelongsTo');
130-
});
130+
});

tests/Feature/TestCategory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ public function posts(): HasMany
2121
{
2222
return $this->hasMany(TestPost::class);
2323
}
24-
}
24+
}

tests/Feature/TestCategoryRelationManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ public function table(Table $table): Table
4949
]),
5050
]);
5151
}
52-
}
52+
}

tests/Feature/TestComment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public function user(): BelongsTo
2727
{
2828
return $this->belongsTo(TestUser::class);
2929
}
30-
}
30+
}

tests/Feature/TestCommentsRelationManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ public function table(Table $table): Table
4646
]),
4747
]);
4848
}
49-
}
49+
}

tests/Feature/TestPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ public function category(): BelongsTo
3434
{
3535
return $this->belongsTo(TestCategory::class);
3636
}
37-
}
37+
}

tests/Feature/TestPostWithRelationsResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ public static function getRelations(): array
6868
TestCategoryRelationManager::class,
6969
];
7070
}
71-
}
71+
}

tests/Feature/TestPostsRelationManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ public function table(Table $table): Table
4848
]),
4949
]);
5050
}
51-
}
51+
}

tests/Feature/TestUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ public function comments(): HasMany
2626
{
2727
return $this->hasMany(TestComment::class);
2828
}
29-
}
29+
}

0 commit comments

Comments
 (0)