Skip to content

Commit

Permalink
tests: Ignore intentionally missing return types in fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Feb 4, 2023
1 parent 1340de5 commit 1b9af0e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions phpstan.tests.neon.dist
Expand Up @@ -31,6 +31,22 @@ parameters:
message: "#^Parameter \\#1 \\$type of static method Nepada\\\\MessageBus\\\\StaticAnalysis\\\\HandlerType\\<Symfony\\\\Component\\\\Messenger\\\\Handler\\\\MessageHandlerInterface\\>\\:\\:fromString\\(\\) expects class\\-string\\<Symfony\\\\Component\\\\Messenger\\\\Handler\\\\MessageHandlerInterface\\>, string given\\.$#"
count: 1
path: tests/MessageBus/StaticAnalysis/Events/EventSubscriberValidatorTest.phpt
- # intentional for tests
message: "#^Method NepadaTests\\\\MessageBus\\\\StaticAnalysis\\\\Commands\\\\Fixtures\\\\HandleMethodHasNoReturnTypeHandler\\:\\:__invoke\\(\\) has no return type specified\\.$#"
count: 1
path: tests/MessageBus/StaticAnalysis/Commands/Fixtures/HandleMethodHasNoReturnTypeHandler.php
- # intentional for tests
message: "#^Method NepadaTests\\\\MessageBus\\\\StaticAnalysis\\\\Events\\\\Fixtures\\\\HandleMethodHasNullReturnTypeOnSomethingValidHappened\\:\\:__invoke\\(\\) has no return type specified\\.$#"
count: 1
path: tests/MessageBus/StaticAnalysis/Events/Fixtures/HandleMethodHasNullReturnTypeOnSomethingValidHappened.php
- # intentional for tests
message: "#^Missing native return typehint (never|void)#"
count: 1
path: tests/MessageBus/StaticAnalysis/Commands/Fixtures/HandleMethodHasNoReturnTypeHandler.php
- # intentional for tests
message: "#^Missing native return typehint (never|void)$#"
count: 1
path: tests/MessageBus/StaticAnalysis/Events/Fixtures/HandleMethodHasNullReturnTypeOnSomethingValidHappened.php
-
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(array\\<Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\StampInterface\\>\\|Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\StampInterface\\)\\: mixed\\)\\|null, Closure\\(Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\HandledStamp\\)\\: string given\\.$#"
count: 1
Expand Down
Expand Up @@ -9,12 +9,12 @@ final class HandleMethodHasNoReturnTypeHandler implements CommandHandler
{

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint
* @param ValidCommand $command
* @return mixed
*/
public function __invoke(ValidCommand $command)
{
return null;
throw new \Exception();
}

}
Expand Up @@ -9,12 +9,12 @@ final class HandleMethodHasNullReturnTypeOnSomethingValidHappened implements Eve
{

/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint
* @param SomethingValidHappenedEvent $event
* @return mixed
*/
public function __invoke(SomethingValidHappenedEvent $event)
{
return null;
throw new \Exception();
}

}

0 comments on commit 1b9af0e

Please sign in to comment.