Kacper Kacper - 1 year ago 82
PHP Question

Symfony 3 with AWS Client throws AnnotationException ("@http" annotation)

I'm about to use

in my Symfony 3.0 project, which uses

I have configured my services, defined AWS credentials and client as services.

<!-- AWS -->
<service id="app.aws_credentials" class="Aws\Credentials\Credentials">
<service id="app.aws_s3.client" class="Aws\S3\S3Client">
<argument type="collection">
<argument key="region">%aws_s3_region%</argument>
<argument key="version">%aws_sdk_version%</argument>
<argument key="credentials" type="service" id="app.aws_credentials"/>

The werid part starts when I run
composer update
fails and throws:

[Semantical Error] The annotation "@http" in method Aws\AwsClientInterface::getCommand() was never imported. Did you maybe forget to add a "use" statement for this annotation?

doens't seem to be an annotation that does anything.

Any ideas how to solve this?

Answer Source

Figured this out some time ago, just forgot to mention here.

Symfony Bundle, provided by Amazon helped, available at https://github.com/aws/aws-sdk-php-symfony

I just used services provided by aws/aws-sdk-php-symfony composer package, instead of defining them by myself.

Works like a charm :)