Skip to content

Commit 5ab521c

Browse files
committed
Update tooling
1 parent 9e03f4e commit 5ab521c

File tree

7 files changed

+12
-6
lines changed

7 files changed

+12
-6
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@
9191
"psr-4": {
9292
"Benchmarks\\": "benchmarks/",
9393
"Tests\\": "tests/"
94-
}
94+
},
95+
"files": [
96+
"vendor/dms/phpunit-arraysubset-asserts/src/ArraySubsetAsserts.php"
97+
]
9598
},
9699
"config": {
97100
"allow-plugins": {

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
]);
3535
$rectorConfig->skip([
3636
__DIR__ . '/src/Tracing/FederatedTracing/Proto', // Generated code
37-
__DIR__ . '/tests/database/migrations', // Does not fit autoloading standards
37+
__DIR__ . '/tests/database/migrations', // Does not fit autoloader standards
3838
__DIR__ . '/tests/LaravelPhpdocAlignmentFixer.php', // Copied from Laravel
3939
CallableThisArrayToAnonymousFunctionRector::class, // Callable in array form is shorter and more efficient
4040
IssetOnPropertyObjectToPropertyExistsRector::class, // isset() is nice when moving towards typed properties

src/Async/AsyncDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function manipulateFieldDefinition(DocumentAST &$documentAST, FieldDefini
7171
$parentName = $parentType->name->value;
7272
if ($parentName !== RootType::MUTATION) {
7373
$location = "{$parentName}.{$fieldDefinition->name->value}";
74-
throw new DefinitionException("The @async directive must only be used on fields of the root type mutation, found it on {$location}.");
74+
throw new DefinitionException("The @async directive must only be used on root mutation fields, found it on {$location}.");
7575
}
7676
}
7777
}

src/Pagination/PaginationManipulator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ private function maybeInheritCacheControlDirective(): string
378378
/** If federation v2 is used, add the @shareable directive to the pagination generic types. */
379379
private function maybeAddShareableDirective(): string
380380
{
381+
// Not using Illuminate\Container\Container::getInstance() here as it causes PHPStan issues
381382
if (app()->providerIsLoaded(FederationServiceProvider::class) && FederationHelper::isUsingFederationV2($this->documentAST)) {
382383
return /** @lang GraphQL */ '@shareable';
383384
}

tests/Integration/Async/AsyncDirectiveTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testDispatchesMutationOnCustomQueue(): void
8080
public function testOnlyOnMutations(): void
8181
{
8282
$this->expectExceptionObject(new DefinitionException(
83-
'The @async directive must only be used on fields of the root type mutation, found it on Query.foo.',
83+
'The @async directive must only be used on root mutation fields, found it on Query.foo.',
8484
));
8585
$this->buildSchema(/** @lang GraphQL */ '
8686
type Query {

tests/Unit/Schema/Directives/HideDirectiveTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Tests\Unit\Schema\Directives;
44

5+
use Illuminate\Container\Container;
56
use Tests\TestCase;
67

78
final class HideDirectiveTest extends TestCase
@@ -59,7 +60,7 @@ public function testHiddenWhenManuallySettingEnv(): void
5960
}
6061
';
6162

62-
app()->instance('env', 'production');
63+
Container::getInstance()->instance('env', 'production');
6364
$this->graphQL($introspectionQuery)
6465
->assertJsonCount(0, 'data.__schema.queryType.fields');
6566
}

tests/Unit/Schema/Directives/ShowDirectiveTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Tests\Unit\Schema\Directives;
44

5+
use Illuminate\Container\Container;
56
use Tests\TestCase;
67

78
final class ShowDirectiveTest extends TestCase
@@ -59,7 +60,7 @@ public function testShownOnAnotherEnv(): void
5960
}
6061
';
6162

62-
app()->instance('env', 'production');
63+
Container::getInstance()->instance('env', 'production');
6364
$this->graphQL($introspectionQuery)
6465
->assertJsonCount(1, 'data.__schema.queryType.fields')
6566
->assertJsonPath('data.__schema.queryType.fields.0.name', 'hiddenField');

0 commit comments

Comments
 (0)