Skip to content
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

Status fields should be public: they are currently private #80

Open
jonjbar opened this issue Sep 27, 2024 · 3 comments
Open

Status fields should be public: they are currently private #80

jonjbar opened this issue Sep 27, 2024 · 3 comments
Assignees

Comments

@jonjbar
Copy link

jonjbar commented Sep 27, 2024

Describe the bug

The file paddle-php-sdk\src\Entities\Shared\Status.php has private "Active" and "Archived" fields when they should be public

Steps to reproduce

Try to list products by using the specific status const

Expected behavior

The fields should be accessible as public

Code snippets

No response

PHP version

PHP 8.2

SDK version

1.20

API version

Paddle Version 1

Additional context

No response

@mikeymike
Copy link
Contributor

Hey @jonjbar 👋

This is actually expected behaviour and is inline with all enums we use in this package. The reason for this is because we chose to utilise the myclabs/php-enum package for enums. Each enum has public static methods behind each of the property definitions that provide the instance of the enum for that value.

Let me know if there's any other uncertainty here and I'll try to elaborate where I can 👍

@mikeymike mikeymike self-assigned this Sep 27, 2024
@jonjbar
Copy link
Author

jonjbar commented Sep 27, 2024

Understood. Thanks.
In that case, shouldn't the "Prices" const in paddle-php-sdk\src\Resources\Products\Operations\List\Includes.php be private then ?

@mikeymike
Copy link
Contributor

Indeed those consts do look to have the incorrect visibility. It would not impact the functionality here with the static method still being the expected usage, however it's possible due to the array usage on the operation that a consumer would expect to pass in the string constant value instead of the enum instance. We'll use this issue to track ensuring the enums consts have the correct visibility throughout the package 👍

Thanks for spotting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants