-
Notifications
You must be signed in to change notification settings - Fork 68
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
add public properties for php 8.2 support #356
Conversation
Contributor License Agreement Instructions Please download the appropriate CLA below. Once downloaded, please read, sign, and send back to us at [email protected]. Please note, this account is not monitored so please visit https://mailchimp.com/contact/ if you need support. Individual CLA: Mailchimp Individual CLA Once you’ve emailed us the signed CLA, please reply here (e.g. CLA signed and sent!) and we’ll verify it. What to do if you already signed the CLA |
|
@sheetal-purple @webkod3r Sorry for the tag, but is there any chance that this could be looked at? Also, I was wondering if CODEOWNERS is up-to-date. |
Hello @earthiverse I'm currently out of office but I'll redirect this to proper channels to get this fixed. |
Hi. I wanted to ask what the status of this is? It seems like https://github.com/mailchimp/mailchimp-marketing-php hasn't been updated yet. |
Hi @olsp, I'm working supporting the Transactional API both for PHP as well as Javascript. I've communicated this concern to the team taking care of marketing API. I'll chat with them today. Please accept my apologies on behalf of them. |
Thanks @webkod3r for your support. Did you get any feedback from the team ? As mentioned, this is blocking upgrade to PHP 8.2, which was released 1 year, 6 months ago so it would be much appreciated if Mailchimp could keep this library up-to-date with currently supported PHP releases, particularly when the only thing needed is merging a community-provided pull request. |
Hello @webkod3r, I see you've merged a PR back in July which, according to #363 (comment), should fix this issue. Many thanks for that ! Unfortunately the change is still not available today, because mailchimp-marketing-php has not been updated (the latest commit as of this writing is still mailchimp/mailchimp-marketing-php@c1a38f7 (Update mailchimp-marketing-php to v3.0.80), committed 2 years ago. It would be awesome if you guys could push the changes and release v3.0.81 including this long-awaited PHP 8.2 compatibility fix which is preventing us from upgrading our server. Thanks in advance ! |
Hi @webkod3r, Apologies for the tag, but my team is also using this package on modern versions of PHP. mailchimp-marketing-php still does not have the aforementioned code from PR #363, as it hasn't seen an update in 2 years. If possible, could mailchimp-marketing-php please be updated with this PHP 8.2 compatibility fix? Thanks in advance! |
Hi @webkod3r, I would also like to ask you when this issue will be resolved. I appreciate any help you can provide. |
Hello, our organization needs an update, aswell. PHP 8.4 is around the corner and this fix for 8.2 is not really something overly complicated. |
Any updates on this ? |
@ramsey I read in another thread that you were in charge of maintaining this library. It would be greatly appreciated if you could prioritize this important compatibility issue which is preventing many users from upgrading their server. The fix is already available, you just need to merge this PR so it's really not a lot of work... Thanks in advance ! |
I also require this for a web application integration that runs on PHP 8.3. Supressing E_WARNING just for this one library is not a great option. Please merge this request. |
I do not currently have access to this repository, so I am unable to help merge this. I will try to follow up with our open source program office to see who can help resolve this. |
Any update on this? |
index a969fb5..a4dd730 100644
--- a/lib/Configuration.php
+++ b/lib/Configuration.php
@@ -63,6 +63,34 @@ class Configuration
protected $tempFolderPath;
protected $timeout = 120;
+ public AccountExportApi $accountExport;
+ public AccountExportsApi $accountExports;
+ public ActivityFeedApi $activityFeed;
+ public AuthorizedAppsApi $authorizedApps;
+ public AutomationsApi $automations;
+ public BatchWebhooksApi $batchWebhooks;
+ public BatchesApi $batches;
+ public CampaignFoldersApi $campaignFolders;
+ public CampaignsApi $campaigns;
+ public ConnectedSitesApi $connectedSites;
+ public ConversationsApi $conversations;
+ public CustomerJourneysApi $customerJourneys;
+ public EcommerceApi $ecommerce;
+ public FacebookAdsApi $facebookAds;
+ public FileManagerApi $fileManager;
+ public LandingPagesApi $landingPages;
+ public ListsApi $lists;
+ public PingApi $ping;
+ public ReportingApi $reporting;
+ public ReportsApi $reports;
+ public RootApi $root;
+ public SearchCampaignsApi $searchCampaigns;
+ public SearchMembersApi $searchMembers;
+ public SurveysApi $Surveys;
+ public TemplateFoldersApi $templateFolders;
+ public TemplatesApi $templates;
+ public VerifiedDomainsApi $verifiedDomains;
+
public function __construct()
{
$this->tempFolderPath = sys_get_temp_dir(); Currently fixing it by patching the lib \w composer patches |
Hey, @MakerTim, a better solution might be to patch it with this line right above the class declaration: #[\AllowDynamicProperties] This will allow setting these as dynamic properties, until we can sort out a solution on the Mailchimp side. Apologies for the delay! |
For those interested in patching the package, check out cweagans/composer-patches. It's not a perfect solution, but it's come in handy for me in the past, and it's marginally better than forking the repo and maintaining your own branch until the upstream gets their act together. ;-) |
/me wonders how much longer that's going to take to just merge this simple PR 🙄 |
We at work discussed the 3 options; Annotation, extends on stdclass or.... just define the damm properties Also for backwards compatibility, they currently support now back till PHP 7.2, extending on \stdclass still follows this behavior, defining properties without a type does to. Adding properties will up the required PHP version to 7.4, what is even EOL as we speak. But adding the annotation like @ramsey suggests is upping it to 8.2, that may be a step too high at once / those who are slow to upgrade to everything new and fancy. Our discussion ended with the "Fixing the Root Cause" instead of a 🩹bandage solution, hence the diff file with adding properties. |
Attributes start with a hash mark, which is treated as a comment in versions of PHP that do not support attributes, so using them will not require PHP 8.2. |
Awesome, thank you @webkod3r ! 🍾🎉 Now we just need a new release of https://github.com/mailchimp/mailchimp-marketing-php |
Description
Similar to #348, but for the marketing API
See https://php.watch/versions/8.2/dynamic-properties-deprecated for why this is necessary.