Skip to content
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"phpstan/phpstan-strict-rules": "1.4.4",
"nepada/phpstan-nette-tester": "1.0.0",
"spaze/phpstan-disallowed-calls": "2.11.5",
"shipmonk/phpstan-rules": "2.0.1",
"shipmonk/phpstan-rules": "2.2.0",
"php-parallel-lint/php-parallel-lint": "1.3.2",
"nepada/coding-standard": "7.6.0"
},
Expand Down
16 changes: 16 additions & 0 deletions phpstan.tests.neon.dist
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ class PreventNestedHandlingMiddlewareTest extends TestCase

private function createTestEnvelope(): Envelope
{
return new Envelope((object) ['testMessage' => true], [new BusNameStamp('test')]);
$message = new \stdClass();
$message->testMessage = true;
return new Envelope($message, [new BusNameStamp('test')]);
}

}
Expand Down
Original file line number Diff line number Diff line change
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();
}

}
Original file line number Diff line number Diff line change
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();
}

}