Skip to content

Commit

Permalink
Merge pull request #194 from ergebnis/fix/invalid
Browse files Browse the repository at this point in the history
Fix: Extend InvalidArgumentException
  • Loading branch information
ergebnis-bot committed Apr 25, 2020
2 parents 0c53951 + 1b89e4c commit 0bc5ae9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Expand Up @@ -176,7 +176,7 @@ parameters:
path: test/Unit/Exception/InvalidFieldDefinitionsTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'RuntimeException' and Ergebnis\\\\FactoryBot\\\\Exception\\\\InvalidFieldDefinitions will always evaluate to true\\.$#"
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'InvalidArgumentException' and Ergebnis\\\\FactoryBot\\\\Exception\\\\InvalidFieldDefinitions will always evaluate to true\\.$#"
count: 1
path: test/Unit/Exception/InvalidFieldDefinitionsTest.php

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidFieldDefinitions.php
Expand Up @@ -15,7 +15,7 @@

use Ergebnis\FactoryBot\FieldDefinition;

final class InvalidFieldDefinitions extends \RuntimeException implements Exception
final class InvalidFieldDefinitions extends \InvalidArgumentException implements Exception
{
public static function values(): self
{
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/Exception/InvalidFieldDefinitionsTest.php
Expand Up @@ -37,7 +37,7 @@ public function testFromClassNameCreatesException(): void
);

self::assertInstanceOf(Exception\InvalidFieldDefinitions::class, $exception);
self::assertInstanceOf(\RuntimeException::class, $exception);
self::assertInstanceOf(\InvalidArgumentException::class, $exception);
self::assertInstanceOf(Exception\Exception::class, $exception);
self::assertSame($message, $exception->getMessage());
}
Expand Down

0 comments on commit 0bc5ae9

Please sign in to comment.