-
Notifications
You must be signed in to change notification settings - Fork 88
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
Incorrect error issued for return value type. #17
Comments
Actually, Opis Closure is returning the correct type, use Aws\S3\S3Client as AwsS3Client;
$container[AwsS3Client::class] = function (Container $container) use ($config): AwsS3Client {
return $container['AwsSdk']->createS3($config);
}; |
Thanks for your response, I tried your solution, doesn't work, I think there is some misunderstanding, And how about the first problem, it can't determine the type correctly, let me give you an simplified example:
Could you please also have a look on this problem, this really bites me. |
Sorry, but I can't reproduce this.It will be much more easy if you can provide me a full example, not just pieces of code. The most simple and reproducible example you can provide. Also, please specify which version of PHP, Opis Closure and Pimple are you using. Thanks. |
Finally, I was able to reproduce the error. I will provide a fix asap. |
This should be fixed in v3.0.9 |
Hello, I meet some weired error when I use
opis closure
to serialize&unserialize pimple container, after unserializing, it seems causing some ambiguity to the return value type.In above closure, the formatter is going to be a class extends from
basicFormatter
, andbasicFormatter
implements theFormatterInterface
, so the return value will be an instance ofFormatterInterface
however I get error message as following:Will get error message as
message":"Return value of Opis\\Closure\\SerializableClosure::{closure}() must be an instance of AwsS3Client, instance of Aws\\S3\\S3Client returned","code":500,
Please help when you get time. Thanks in advance.
The text was updated successfully, but these errors were encountered: