-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Description
When using the Adyen PHP API library in a Symfony project, I encounter a "Semantical Error" related to annotation parsing. This error occurs because the @description tag within the PHPDoc block for the Adyen\Model\Checkout\PaymentResponseAction class is being incorrectly interpreted as a real annotation.
Steps to reproduce
- Install the Adyen PHP API library via Composer in a Symfony project.
- Use the Adyen\Model\Checkout\PaymentResponseAction class in your Symfony code.
- The error will occur when the class is loaded and the annotations are parsed.
Actual behavior
The specific error message from Symfony is:
[Semantical Error] The annotation "@description" in class Adyen\Model\Checkout\PaymentResponseAction was never imported. Did you maybe forget to add a "use" statement for this annotation?
Expected behavior
I expect the class to not throw this exception when using whith Symfony 6
Code snippet or screenshots (if applicable)
// I've used this service for the Session creation with no issue
$this->paymentService = new PaymentsApi($this->client);
// Send the request with default params from the Adyen doc
$request = $this->paymentService->payments($paymentRequest, $requestOptions);
// The error occurs only when I fecth the action from the result
if (!empty($request->getAction())) {
return $request->getAction();
}Adyen PHP API Library version
27.0.0
PHP version
8.2
Operating System
Windows
Additional context
It appears that the code might be generated by OpenAPI Generator, which might be the source of the incorrect @description tag.
The issue is comming from the description comment in the class PaymentResponseAction :
/**
* PaymentResponseAction Class Doc Comment
*
* @category Class
* @description Action to be taken for completing the payment. <--- HERE
* @package Adyen
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements \ArrayAccess<string, mixed>
*/
class PaymentResponseAction implements ModelInterface, ArrayAccess, \JsonSerializable
{
// The rest of the class
}Current Workaround:
The issue can be temporarily resolved by manually editing the Adyen\Model\Checkout\PaymentResponseAction.php file in the vendor directory and removing the @ symbol from the line (e.g., changing it to Description:).
I hope this information is helpful in resolving this issue. Please let me know if you need any more details.