Skip to content

Commit d502f32

Browse files
committed
Renaming exception to keep names in sync
1 parent a73f2eb commit d502f32

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Mappers/Parameters/AssertParameterMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function mapParameter(ReflectionParameter $refParameter, DocBlock $docBlo
5151
}
5252

5353
if (! $parameter instanceof InputTypeParameterInterface) {
54-
throw InvalidAssertAnnotationException::canOnlyValidateInputType($refParameter);
54+
throw InvalidAssertionAnnotationException::canOnlyValidateInputType($refParameter);
5555
}
5656

5757
// Let's wrap the ParameterInterface into a ParameterValidator.

src/Mappers/Parameters/InvalidAssertAnnotationException.php renamed to src/Mappers/Parameters/InvalidAssertionAnnotationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Exception;
88
use ReflectionParameter;
99

10-
class InvalidAssertAnnotationException extends Exception
10+
class InvalidAssertionAnnotationException extends Exception
1111
{
1212
public static function canOnlyValidateInputType(ReflectionParameter $refParameter): self
1313
{

tests/IntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use TheCodingMachine\GraphQLite\SchemaFactory;
2424
use TheCodingMachine\Graphqlite\Validator\Fixtures\Controllers\UserController;
2525
use TheCodingMachine\Graphqlite\Validator\Mappers\Parameters\AssertParameterMiddleware;
26-
use TheCodingMachine\Graphqlite\Validator\Mappers\Parameters\InvalidAssertAnnotationException;
26+
use TheCodingMachine\Graphqlite\Validator\Mappers\Parameters\InvalidAssertionAnnotationException;
2727
use function var_dump;
2828
use function var_export;
2929
use const JSON_PRETTY_PRINT;
@@ -162,7 +162,7 @@ public function testException(): void
162162
$schemaFactory->addControllerNamespace('TheCodingMachine\Graphqlite\Validator\Fixtures\InvalidControllers');
163163
$schema = $schemaFactory->createSchema();
164164

165-
$this->expectException(InvalidAssertAnnotationException::class);
165+
$this->expectException(InvalidAssertionAnnotationException::class);
166166
$this->expectExceptionMessage('In method TheCodingMachine\Graphqlite\Validator\Fixtures\InvalidControllers\InvalidController::invalid(), the @Assert annotation is targeting parameter "$resolveInfo". You cannot target this parameter because it is not part of the GraphQL Input type. You can only assert parameters coming from the end user.');
167167
$schema->validate();
168168
}

0 commit comments

Comments
 (0)