I noticed that the package uses the inheritance pattern in several locations of the project to extend functionality and/or properties. This is great as it avoids code duplication, but it seems to missing a crucial part: calling the parent constructor (parent::__construct();).
For example, the ShoppingSetting extends from Setting class. The Setting class sets the Type property based on the model name for convenience and as it is required by the API. This flow is the same as the previous/older bingads package, however, this part doesn't seem to work as the call to the parent constructor is missing.
Setting class: https://github.com/BingAds/BingAds-PHP-REST-SDK/blob/v13.0.24.1/src/Model/CampaignManagementService/Setting.php#L473
ShoppingSetting: https://github.com/BingAds/BingAds-PHP-REST-SDK/blob/v13.0.24.1/src/Model/CampaignManagementService/ShoppingSetting.php#L257
I'm currently upgrading my code to support this new REST package, but it seems that my code isn't 100% the same due this small mishap. I need to to define/set more properties now that would have otherwise been set automatically.
I feel like this is happening in more places, so I'm curious if this is intentional or whether this is a simple mistake that would be patched in upcoming versions?
I noticed that the package uses the inheritance pattern in several locations of the project to extend functionality and/or properties. This is great as it avoids code duplication, but it seems to missing a crucial part: calling the parent constructor (
parent::__construct();).For example, the
ShoppingSettingextends fromSettingclass. TheSettingclass sets theTypeproperty based on the model name for convenience and as it is required by the API. This flow is the same as the previous/older bingads package, however, this part doesn't seem to work as the call to the parent constructor is missing.Settingclass: https://github.com/BingAds/BingAds-PHP-REST-SDK/blob/v13.0.24.1/src/Model/CampaignManagementService/Setting.php#L473ShoppingSetting: https://github.com/BingAds/BingAds-PHP-REST-SDK/blob/v13.0.24.1/src/Model/CampaignManagementService/ShoppingSetting.php#L257I'm currently upgrading my code to support this new REST package, but it seems that my code isn't 100% the same due this small mishap. I need to to define/set more properties now that would have otherwise been set automatically.
I feel like this is happening in more places, so I'm curious if this is intentional or whether this is a simple mistake that would be patched in upcoming versions?