Skip to content

[Bug]: Annotation parsing error due to @description in PaymentResponseAction PHPDoc #757

@MartinDeMarcy

Description

@MartinDeMarcy

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

  1. Install the Adyen PHP API library via Composer in a Symfony project.
  2. Use the Adyen\Model\Checkout\PaymentResponseAction class in your Symfony code.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions