Skip to content

Commit 62a9ff9

Browse files
Nielsvanpachactions-user
authored andcommitted
Fix styling
1 parent ad58c68 commit 62a9ff9

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

src/AllowedInclude.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function relationship(string $name, ?string $internalName = null):
3636
[$relationship, $alias] = $args;
3737

3838
$includes = collect([
39-
new self($alias, new IncludedRelationship, $relationship),
39+
new self($alias, new IncludedRelationship(), $relationship),
4040
]);
4141

4242
if (! Str::contains($relationship, '.')) {

src/AllowedSort.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function sort(QueryBuilder $query, ?bool $descending = null): void
4747

4848
public static function field(string $name, ?string $internalName = null): self
4949
{
50-
return new static($name, new SortsField, $internalName);
50+
return new static($name, new SortsField(), $internalName);
5151
}
5252

5353
public static function custom(string $name, Sort $sortClass, ?string $internalName = null): self

tests/FilterTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public function it_can_filter_results_by_a_custom_filter_class()
291291
{
292292
$testModel = $this->models->first();
293293

294-
$filterClass = new class implements FilterInterface {
294+
$filterClass = new class() implements FilterInterface {
295295
public function __invoke(Builder $query, $value, string $property): Builder
296296
{
297297
return $query->where('name', $value);
@@ -468,7 +468,7 @@ public function it_should_apply_the_filter_on_the_subset_of_allowed_values()
468468
/** @test */
469469
public function it_can_take_an_argument_for_custom_column_name_resolution()
470470
{
471-
$filter = AllowedFilter::custom('property_name', new FiltersExact, 'property_column_name');
471+
$filter = AllowedFilter::custom('property_name', new FiltersExact(), 'property_column_name');
472472

473473
$this->assertInstanceOf(AllowedFilter::class, $filter);
474474
$this->assertClassHasAttribute('internalName', get_class($filter));
@@ -477,15 +477,15 @@ public function it_can_take_an_argument_for_custom_column_name_resolution()
477477
/** @test */
478478
public function it_sets_property_column_name_to_property_name_by_default()
479479
{
480-
$filter = AllowedFilter::custom('property_name', new FiltersExact);
480+
$filter = AllowedFilter::custom('property_name', new FiltersExact());
481481

482482
$this->assertEquals($filter->getName(), $filter->getInternalName());
483483
}
484484

485485
/** @test */
486486
public function it_resolves_queries_using_property_column_name()
487487
{
488-
$filter = AllowedFilter::custom('nickname', new FiltersExact, 'name');
488+
$filter = AllowedFilter::custom('nickname', new FiltersExact(), 'name');
489489

490490
TestModel::create(['name' => 'abcdef']);
491491

tests/IncludeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public function it_can_alias_multiple_allowed_includes()
348348
/** @test */
349349
public function it_can_include_custom_include_class()
350350
{
351-
$includeClass = new class implements IncludeInterface {
351+
$includeClass = new class() implements IncludeInterface {
352352
public function __invoke(Builder $query, string $include): Builder
353353
{
354354
// TODO:
@@ -369,7 +369,7 @@ public function __invoke(Builder $query, string $include): Builder
369369
/** @test */
370370
public function it_can_include_custom_include_class_by_alias()
371371
{
372-
$includeClass = new class implements IncludeInterface {
372+
$includeClass = new class() implements IncludeInterface {
373373
public function __invoke(Builder $query, string $include): Builder
374374
{
375375
// TODO:
@@ -390,7 +390,7 @@ public function __invoke(Builder $query, string $include): Builder
390390
/** @test */
391391
public function it_can_take_an_argument_for_custom_column_name_resolution()
392392
{
393-
$include = AllowedInclude::custom('property_name', new IncludedCount, 'property_column_name');
393+
$include = AllowedInclude::custom('property_name', new IncludedCount(), 'property_column_name');
394394

395395
$this->assertInstanceOf(Collection::class, $include);
396396
$this->assertInstanceOf(AllowedInclude::class, $include->first());
@@ -405,7 +405,7 @@ public function it_can_include_a_custom_base_query_with_select()
405405
]);
406406

407407
$modelResult = QueryBuilder::for(TestModel::select('id', 'name'), $request)
408-
->allowedIncludes(AllowedInclude::custom('relatedModelsCount', new IncludedCount, 'relatedModels'))
408+
->allowedIncludes(AllowedInclude::custom('relatedModelsCount', new IncludedCount(), 'relatedModels'))
409409
->first();
410410

411411
$this->assertNotNull($modelResult->related_models_count);

tests/QueryBuilderTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function it_can_query_local_scopes()
204204
/** @test */
205205
public function it_executes_the_same_query_regardless_of_the_order_of_applied_filters_or_sorts()
206206
{
207-
$customSort = new class implements Sort {
207+
$customSort = new class() implements Sort {
208208
public function __invoke(Builder $query, $descending, string $property): Builder
209209
{
210210
return $query->join(
@@ -237,7 +237,7 @@ public function __invoke(Builder $query, $descending, string $property): Builder
237237
/** @test */
238238
public function it_can_filter_when_sorting_by_joining_a_related_model_which_contains_the_same_field_name()
239239
{
240-
$customSort = new class implements Sort {
240+
$customSort = new class() implements Sort {
241241
public function __invoke(Builder $query, $descending, string $property): Builder
242242
{
243243
return $query->join(
@@ -297,13 +297,13 @@ public function it_does_not_lose_pivot_values_with_belongs_to_many_relation()
297297
$foundTestModel->pivot->location
298298
);
299299
}
300-
301-
300+
301+
302302
/** @test */
303303
public function it_clones_the_subject_upon_cloning()
304304
{
305305
$queryBuilder = QueryBuilder::for(TestModel::class);
306-
306+
307307
$queryBuilder1 = (clone $queryBuilder)->where('id', 1);
308308
$queryBuilder2 = (clone $queryBuilder)->where('name', 'John Doe');
309309

@@ -312,12 +312,12 @@ public function it_clones_the_subject_upon_cloning()
312312
$queryBuilder2->toSql()
313313
);
314314
}
315-
315+
316316
/** @test */
317317
public function it_supports_clone_as_method()
318318
{
319319
$queryBuilder = QueryBuilder::for(TestModel::class);
320-
320+
321321
$queryBuilder1 = $queryBuilder->clone()->where('id', 1);
322322
$queryBuilder2 = $queryBuilder->clone()->where('name', 'John Doe');
323323

tests/SortTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function it_doesnt_use_the_default_sort_parameter_when_a_sort_was_request
235235
/** @test */
236236
public function it_allows_default_custom_sort_class_parameter()
237237
{
238-
$sortClass = new class implements SortInterface {
238+
$sortClass = new class() implements SortInterface {
239239
public function __invoke(Builder $query, bool $descending, string $property): Builder
240240
{
241241
return $query->orderBy('name', $descending ? 'desc' : 'asc');
@@ -266,7 +266,7 @@ public function it_uses_default_descending_sort_parameter()
266266
/** @test */
267267
public function it_allows_multiple_default_sort_parameters()
268268
{
269-
$sortClass = new class implements SortInterface {
269+
$sortClass = new class() implements SortInterface {
270270
public function __invoke(Builder $query, $descending, string $property): Builder
271271
{
272272
return $query->orderBy('name', $descending ? 'desc' : 'asc');
@@ -324,7 +324,7 @@ public function it_can_sort_by_multiple_columns()
324324
/** @test */
325325
public function it_can_sort_by_a_custom_sort_class()
326326
{
327-
$sortClass = new class implements SortInterface {
327+
$sortClass = new class() implements SortInterface {
328328
public function __invoke(Builder $query, $descending, string $property): Builder
329329
{
330330
return $query->orderBy('name', $descending ? 'desc' : 'asc');
@@ -343,7 +343,7 @@ public function __invoke(Builder $query, $descending, string $property): Builder
343343
/** @test */
344344
public function it_can_take_an_argument_for_custom_column_name_resolution()
345345
{
346-
$sort = AllowedSort::custom('property_name', new SortsField, 'property_column_name');
346+
$sort = AllowedSort::custom('property_name', new SortsField(), 'property_column_name');
347347

348348
$this->assertInstanceOf(AllowedSort::class, $sort);
349349
$this->assertClassHasAttribute('internalName', get_class($sort));
@@ -352,15 +352,15 @@ public function it_can_take_an_argument_for_custom_column_name_resolution()
352352
/** @test */
353353
public function it_sets_property_column_name_to_property_name_by_default()
354354
{
355-
$sort = AllowedSort::custom('property_name', new SortsField);
355+
$sort = AllowedSort::custom('property_name', new SortsField());
356356

357357
$this->assertEquals($sort->getName(), $sort->getInternalName());
358358
}
359359

360360
/** @test */
361361
public function it_resolves_queries_using_property_column_name()
362362
{
363-
$sort = AllowedSort::custom('nickname', new SortsField, 'name');
363+
$sort = AllowedSort::custom('nickname', new SortsField(), 'name');
364364

365365
$testModel = TestModel::create(['name' => 'zzzzzzzz']);
366366

@@ -419,7 +419,7 @@ public function late_specified_sorts_still_check_for_allowance()
419419
/** @test */
420420
public function it_can_sort_and_use_scoped_filters_at_the_same_time()
421421
{
422-
$sortClass = new class implements SortInterface {
422+
$sortClass = new class() implements SortInterface {
423423
public function __invoke(Builder $query, $descending, string $property): Builder
424424
{
425425
return $query->orderBy('name', $descending ? 'desc' : 'asc');
@@ -472,7 +472,7 @@ public function raw_sorts_do_not_get_purged_when_specifying_allowed_sorts()
472472
/** @test */
473473
public function the_default_direction_of_an_allow_sort_can_be_set()
474474
{
475-
$sortClass = new class implements SortInterface {
475+
$sortClass = new class() implements SortInterface {
476476
public function __invoke(Builder $query, bool $descending, string $property): Builder
477477
{
478478
return $query->orderBy('name', $descending ? 'desc' : 'asc');

0 commit comments

Comments
 (0)