-
Notifications
You must be signed in to change notification settings - Fork 93
Add EnvelopeReturnTypeExtension for symfony/messenger #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
$envelope = new \Symfony\Component\Messenger\Envelope(new stdClass()); | ||
|
||
$test1 = $envelope->all(\Symfony\Component\Messenger\Stamp\ReceivedStamp::class); | ||
$test2 = $envelope->all(random_bytes(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any better way to pass a "non-constant-string" in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is fine.
): Type | ||
{ | ||
if (count($methodCall->args) === 0) { | ||
return new ArrayType(new MixedType(), new ArrayType(new MixedType(), new ObjectType(StampInterface::class))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StampInterface
needs to be a string here, so that composer require checker doesn't complain. I know, not ideal.
|
||
$argType = $scope->getType($methodCall->args[0]->value); | ||
if (!$argType instanceof ConstantStringType) { | ||
return new ArrayType(new MixedType(), new ObjectType(StampInterface::class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and here...
@lookyman Fixed. In my opinion composer require checker should ignore |
@enumag Yes, I think so as well. Some things are still failing, but I'll fix those. Thanks! |
@lookyman Thank you! |
Closes #43