Class constructor property promotion

jens.luetkens
jens.luetkens Spryker Solution Partner Posts: 3 🧑🏻‍🚀 - Cadet

Spryker has recently introduced class constructor properties in the customer model vendor/spryker/customer/src/Spryker/Zed/Customer/Business/Customer/Customer.php
This seems like a big problem when it comes to extending the class in the Pyz code. As far as I am aware you can't just replace e.g. the $customerConfig with the Pyz version, as it breaks the type/compatibility. You could add a $pyzCustomerConfig but that breaks inheritance, or you had to overwrite every single line which uses $customerConfig . I hope I see it wrong, can you please share how to handle these situations?

Comments