Skip to content

Commit 9683c02

Browse files
Autofix
1 parent 4b3aafe commit 9683c02

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Validator/ValidationCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface ValidationCache
3030
*
3131
* @return bool true if validation for the given schema + AST + rules is already known to be valid; false otherwise
3232
*/
33-
public function isValidated(Schema $schema, DocumentNode $ast, array $rules = null): bool;
33+
public function isValidated(Schema $schema, DocumentNode $ast, ?array $rules = null): bool;
3434

3535
/**
3636
* @param array<ValidationRule>|null $rules
@@ -40,5 +40,5 @@ public function isValidated(Schema $schema, DocumentNode $ast, array $rules = nu
4040
* This is typically called after a query passes validation.
4141
* You should store enough information to recognize this combination on future requests.
4242
*/
43-
public function markValidated(Schema $schema, DocumentNode $ast, array $rules = null): void;
43+
public function markValidated(Schema $schema, DocumentNode $ast, ?array $rules = null): void;
4444
}

tests/Executor/TestClasses/SpyValidationCacheAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ final class SpyValidationCacheAdapter extends PsrValidationCacheAdapter
1212

1313
public int $markValidatedCalls = 0;
1414

15-
public function isValidated(Schema $schema, DocumentNode $ast, array $rules = null): bool
15+
public function isValidated(Schema $schema, DocumentNode $ast, ?array $rules = null): bool
1616
{
1717
++$this->isValidatedCalls;
1818

1919
return parent::isValidated($schema, $ast);
2020
}
2121

22-
public function markValidated(Schema $schema, DocumentNode $ast, array $rules = null): void
22+
public function markValidated(Schema $schema, DocumentNode $ast, ?array $rules = null): void
2323
{
2424
++$this->markValidatedCalls;
2525

tests/PsrValidationCacheAdapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
* @throws InvariantViolation
3737
* @throws SerializationError
3838
*/
39-
public function isValidated(Schema $schema, DocumentNode $ast, array $rules = null): bool
39+
public function isValidated(Schema $schema, DocumentNode $ast, ?array $rules = null): bool
4040
{
4141
$key = $this->buildKey($schema, $ast);
4242

@@ -52,7 +52,7 @@ public function isValidated(Schema $schema, DocumentNode $ast, array $rules = nu
5252
* @throws InvariantViolation
5353
* @throws SerializationError
5454
*/
55-
public function markValidated(Schema $schema, DocumentNode $ast, array $rules = null): void
55+
public function markValidated(Schema $schema, DocumentNode $ast, ?array $rules = null): void
5656
{
5757
$key = $this->buildKey($schema, $ast);
5858

@@ -67,7 +67,7 @@ public function markValidated(Schema $schema, DocumentNode $ast, array $rules =
6767
* @throws InvariantViolation
6868
* @throws SerializationError
6969
*/
70-
private function buildKey(Schema $schema, DocumentNode $ast, array $rules = null): string
70+
private function buildKey(Schema $schema, DocumentNode $ast, ?array $rules = null): string
7171
{
7272
/**
7373
* This default strategy generates a cache key by hashing the printed schema and AST.
@@ -78,6 +78,6 @@ private function buildKey(Schema $schema, DocumentNode $ast, array $rules = null
7878
$astHash = md5(serialize($ast));
7979
$rulesHash = md5(serialize($rules));
8080

81-
return "graphql_validation_{$schemaHash}_{$astHash}_$rulesHash";
81+
return "graphql_validation_{$schemaHash}_{$astHash}_{$rulesHash}";
8282
}
8383
}

0 commit comments

Comments
 (0)