fix(phpstan): better error handling and class usage
This commit fixes several areas: 1. It changes class type in BasketOrder from QUI\\Users\\User to QUI\\Interfaces\\Users\\User. 2. It refactors Order to better handle if statements and moves verification of class existence up to the beginning. Fix involves assuming that function getInvoiceAddress and getDeliveryAddress always return a non-null value. It also updates on how we check class exists for Shipping data. 3. In OrderInProcess, now we check if method 'toArticle' exists on the Product object before calling it and applies similar class checking like in Order for Shipping data. 4. Corrects and standardizes the casing for exception catching in OrderProcess. In summary, these changes lead to a safer and cleaner code base by addressing potential Null Pointer Exceptions and ensuring the existence of classes before they are being called. Related: #172
Übergeordneter
f11a7d4b
No related branches found
No related tags found
- src/QUI/ERP/Order/Basket/BasketOrder.php 1 Ergänzung, 1 Löschungsrc/QUI/ERP/Order/Basket/BasketOrder.php
- src/QUI/ERP/Order/Order.php 11 Ergänzungen, 15 Löschungensrc/QUI/ERP/Order/Order.php
- src/QUI/ERP/Order/OrderInProcess.php 11 Ergänzungen, 8 Löschungensrc/QUI/ERP/Order/OrderInProcess.php
- src/QUI/ERP/Order/OrderProcess.php 3 Ergänzungen, 2 Löschungensrc/QUI/ERP/Order/OrderProcess.php
Bitte registrieren oder Anmelden zum Kommentieren