Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for implicit nullability deprecation #1152

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function addTypes(array $types): void
/**
* @param object|string $class
*/
public function addType($class, string $name = null): void
public function addType($class, ?string $name = null): void
{
if (!$name) {
$type = \is_object($class) ? $class : $this->app->make($class);
Expand Down Expand Up @@ -487,7 +487,7 @@ protected function clearTypeInstances(): void
$this->typesInstances = [];
}

public function paginate(string $typeName, string $customName = null): Type
public function paginate(string $typeName, ?string $customName = null): Type
{
$name = $customName ?: $typeName . 'Pagination';

Expand All @@ -499,7 +499,7 @@ public function paginate(string $typeName, string $customName = null): Type
return $this->typesInstances[$name];
}

public function simplePaginate(string $typeName, string $customName = null): Type
public function simplePaginate(string $typeName, ?string $customName = null): Type
{
$name = $customName ?: $typeName . 'SimplePagination';

Expand Down
2 changes: 1 addition & 1 deletion src/Support/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class Field
* @param mixed $root
* @param mixed $ctx
*/
public function authorize($root, array $args, $ctx, ResolveInfo $resolveInfo = null, Closure $getSelectFields = null): bool
public function authorize($root, array $args, $ctx, ?ResolveInfo $resolveInfo = null, ?Closure $getSelectFields = null): bool
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Support/PaginationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class PaginationType extends ObjectType
{
public function __construct(string $typeName, string $customName = null)
public function __construct(string $typeName, ?string $customName = null)
{
$name = $customName ?: $typeName . 'Pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/Support/SimplePaginationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class SimplePaginationType extends ObjectType
{
public function __construct(string $typeName, string $customName = null)
public function __construct(string $typeName, ?string $customName = null)
{
$name = $customName ?: $typeName . 'SimplePagination';

Expand Down
2 changes: 1 addition & 1 deletion tests/Support/Objects/ExamplesAuthorizeMessageQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ExamplesAuthorizeMessageQuery extends Query
'name' => 'Examples authorize query',
];

public function authorize($root, array $args, $ctx, ResolveInfo $resolveInfo = null, Closure $getSelectFields = null): bool
public function authorize($root, array $args, $ctx, ?ResolveInfo $resolveInfo = null, ?Closure $getSelectFields = null): bool
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/Objects/ExamplesAuthorizeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ExamplesAuthorizeQuery extends Query
'name' => 'Examples authorize query',
];

public function authorize($root, array $args, $ctx, ResolveInfo $resolveInfo = null, Closure $getSelectFields = null): bool
public function authorize($root, array $args, $ctx, ?ResolveInfo $resolveInfo = null, ?Closure $getSelectFields = null): bool
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/Traits/MakeCommandAssertionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function assertMakeCommand(
string $expectedFilename,
string $expectedNamespace,
string $expectedClassDefinition,
string $expectedGraphqlName = null
?string $expectedGraphqlName = null
): void {
$filesystemMock = $this
->getMockBuilder(Filesystem::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ValidationAndAuthorizationMutation extends Mutation
'name' => 'validationAndAuthorization',
];

public function authorize($root, array $args, $ctx, ResolveInfo $resolveInfo = null, Closure $getSelectFields = null): bool
public function authorize($root, array $args, $ctx, ?ResolveInfo $resolveInfo = null, ?Closure $getSelectFields = null): bool
{
return 'value1' === $args['arg1'];
}
Expand Down