klaviyo / klaviyo-api-php

PHP SDK for Klaviyo API
https://developers.klaviyo.com
MIT License
46 stars 21 forks source link

Constant names assigned twice #19

Closed DannyDan closed 1 year ago

DannyDan commented 1 year ago

In file klaviyo/api/lib/Model/MetricAggregateQueryResourceObjectAttributes.php are several constant assigned twice.

public const SORT_BOUNCE_TYPE = 'Bounce Type';
public const SORT_BOUNCE_TYPE = '-Bounce Type';
public const SORT_CAMPAIGN_NAME = 'Campaign Name';
public const SORT_CAMPAIGN_NAME = '-Campaign Name';
public const SORT_CLIENT_CANONICAL = 'Client Canonical';
public const SORT_CLIENT_CANONICAL = '-Client Canonical';
public const SORT_CLIENT_NAME = 'Client Name';
public const SORT_CLIENT_NAME = '-Client Name';
public const SORT_CLIENT_TYPE = 'Client Type';
public const SORT_CLIENT_TYPE = '-Client Type';
public const SORT_EMAIL_DOMAIN = 'Email Domain';
public const SORT_EMAIL_DOMAIN = '-Email Domain';
public const SORT_FAILURE_SOURCE = 'Failure Source';
public const SORT_FAILURE_SOURCE = '-Failure Source';
public const SORT_FAILURE_TYPE = 'Failure Type';
public const SORT_FAILURE_TYPE = '-Failure Type';
public const SORT_FROM_NUMBER = 'From Number';
public const SORT_FROM_NUMBER = '-From Number';
public const SORT_FROM_PHONE_REGION = 'From Phone Region';
public const SORT_FROM_PHONE_REGION = '-From Phone Region';
public const SORT__LIST = 'List';
public const SORT__LIST = '-List';
public const SORT_MESSAGE_NAME = 'Message Name';
public const SORT_MESSAGE_NAME = '-Message Name';
public const SORT_MESSAGE_TYPE = 'Message Type';
public const SORT_MESSAGE_TYPE = '-Message Type';
public const SORT_METHOD = 'Method';
public const SORT_METHOD = '-Method';
public const SORT_SUBJECT = 'Subject';
public const SORT_SUBJECT = '-Subject';
public const SORT_TO_NUMBER = 'To Number';
public const SORT_TO_NUMBER = '-To Number';
public const SORT_TO_PHONE_REGION = 'To Phone Region';
public const SORT_TO_PHONE_REGION = '-To Phone Region';
public const SORT_URL = 'URL';
public const SORT_URL = '-URL';
public const SORT_COUNT = 'count';
public const SORT_COUNT = '-count';
public const SORT_FORM_ID = 'form_id';
public const SORT_FORM_ID = '-form_id';
public const SORT_SUM_VALUE = 'sum_value';
public const SORT_SUM_VALUE = '-sum_value';
public const SORT_UNIQUE = 'unique';
public const SORT_UNIQUE = '-unique';

Whats the background for this?

jon-batscha commented 1 year ago

Thanks for raising the issue, looking into a fix. In the meanwhile i'd like to understand: how this is impacting your workflow? Thanks!

In case you're curious about the the underlying cause for this: it's due to the package we use to generate the sdk from our spec ignoring dashes in strings when generating variable names for enum values

DannyDan commented 1 year ago

It is impacting me because Shopwares automatic Code Review fails at this points and I have to remove the constants manually in order to get my integration into the Shopware store. ;)

jon-batscha commented 1 year ago

cool, good to know, i appreciate the insight. I should have a fix shortly, i'll update you when it's released

jon-batscha commented 1 year ago

just released a version with a fix, 3.0.0.

An additional change going out with this release: the page_size optional param previously came last, now it's back in order, so you may need to update a call or two if you see any errors when migrating to this latest version.

jon-batscha commented 1 year ago

(closing this issue for now, but please follow up if you run into any further issues)

DannyDan commented 1 year ago

@jon-batscha super, thank you very much for resolving this.