Commits auf Quelle (9)
-
verfasst von Henning Leutz
This commit does the following changes: 1. Updated the PHPStan version from 1.11.8 to 1.12.13 in phars.xml 2. In various classes, added the possibility to pass `null` as a parameter to a number of functions. Affected classes include but are not limited to: `ShippingInterface`, `Handler`, `Status`, `StatusUnknown`, and `ShippingEntry`. 3. Updated return types in the `ShippingEntry` class to include `null` option. 4. Simplified return types in various places from `datatype|datatype|null` to possibly nullable `datatype`. PHP9 + PHP8.4 null deprecated
8490a644 -
verfasst von Henning Leutz
Updated method argument typings from `Type $var = null` to `null | Type $var = null` across multiple files to improve readability and understanding of the code. This change aligns with modern coding standards and the principle of explicit over implicit. Affected files: - `AbstractShippingEntry.php` - `AbstractShippingType.php` - `ShippingInterface.php` - `ShippingTypeInterface.php` - `Factory.php` - `ShippingRule.php` - `Shipping.php` PHP9 + PHP8.3 null deprecated
ac6dda13 -
verfasst von Henning Leutz
This commit includes several changes to improve type handling and the returns of various methods. It includes changes in files related to Shipping rules and status, as well as tracking. Notable changes include: - Refactoring of method signatures and corresponding usages to use type hinting for better error handling. - Fixed return types in Factory.php to return more specific types (ShippingRule and ShippingEntry). - Adjusted the createShippingStatus method to convert `id` to string before passing it to setValue method in Config. - Fixed active carrier filtering in Tracking for boolean conversion. - Modified handling and events related to shipping in ShippingEntry.php and Factory.php. - Other minor cleanups and refactorings. Related: #55
e5ed940a -
verfasst von Henning Leutz
This commit enhances the type enforcement in the Shipping module by explicitly checking for method existence before calls on variable types. In addition, it enforces argument type checks for several function and method declarations to avoid type-related errors. Moreover, the error handling in different functions has been improved by catching potential exceptions and logging them for debug purposes. The commit also optimizes a PHP sorting function by leveraging the spaceship operator instead of using conventional comparisons. Related: #55
c79bc5df -
verfasst von Henning Leutz
This commit refactors the getShippingPriceFactor method in the Shipping.php file, by adding a line break for the method's parameter for better visibility and readability.
c87fe722 -
verfasst von Henning Leutz
This commit resolves multiple issues identified by the phpstan static analysis tool. The erroneous types and classes in `AbstractShippingEntry.php`, `EventHandler.php`, `ShippingTimePeriod.php` have been refractored to match the correct class and method signatures. The erroneous sections have been updated with the appropriate classes and methods for QUI\\\\ERP\\\\Accounting\\\\Invoice, QUI\\\\ERP\\\\Accounting\\\\Offers, and QUI\\\\ERP\\\\SalesOrders. Related: #55
7da729e9 -
verfasst von Henning Leutz
Updated the error message in the phpstan-baseline to reflect the compatibility between the getFrontendView methods in ShippingTimePeriod and TimePeriod classes.
b5ad037d -
verfasst von Henning Leutz
This commit changes the incorrect return type message found in the phpstan-baseline.neon file. Return type of method ShippingTimePeriod::getFrontendView() has been correctly aligned to match that of TimePeriod::getFrontendView(). This ensures clear and accurate type error messages that adhere to the standard format.
ab8fc62b -
verfasst von Henning Leutz
fix(phpstan): allow null as parameter in various functions See merge request !45
- .phive/phars.xml 1 Ergänzung, 1 Löschung.phive/phars.xml
- ajax/backend/rules/getRules.php 8 Ergänzungen, 13 Löschungenajax/backend/rules/getRules.php
- phpstan-baseline.neon 61 Ergänzungen, 260 Löschungenphpstan-baseline.neon
- src/QUI/ERP/Shipping/Api/AbstractShippingEntry.php 2 Ergänzungen, 2 Löschungensrc/QUI/ERP/Shipping/Api/AbstractShippingEntry.php
- src/QUI/ERP/Shipping/Api/AbstractShippingType.php 2 Ergänzungen, 2 Löschungensrc/QUI/ERP/Shipping/Api/AbstractShippingType.php
- src/QUI/ERP/Shipping/Api/ShippingInterface.php 4 Ergänzungen, 4 Löschungensrc/QUI/ERP/Shipping/Api/ShippingInterface.php
- src/QUI/ERP/Shipping/Api/ShippingTypeInterface.php 2 Ergänzungen, 2 Löschungensrc/QUI/ERP/Shipping/Api/ShippingTypeInterface.php
- src/QUI/ERP/Shipping/EventHandler.php 40 Ergänzungen, 12 Löschungensrc/QUI/ERP/Shipping/EventHandler.php
- src/QUI/ERP/Shipping/Methods/Digital/ShippingType.php 0 Ergänzungen, 1 Löschungsrc/QUI/ERP/Shipping/Methods/Digital/ShippingType.php
- src/QUI/ERP/Shipping/Methods/Standard/ShippingType.php 0 Ergänzungen, 1 Löschungsrc/QUI/ERP/Shipping/Methods/Standard/ShippingType.php
- src/QUI/ERP/Shipping/Order/Shipping.php 10 Ergänzungen, 4 Löschungensrc/QUI/ERP/Shipping/Order/Shipping.php
- src/QUI/ERP/Shipping/Products/Fields/ShippingTimeFrontendView.php 1 Ergänzung, 3 Löschungen...ERP/Shipping/Products/Fields/ShippingTimeFrontendView.php
- src/QUI/ERP/Shipping/Rules/Factory.php 10 Ergänzungen, 7 Löschungensrc/QUI/ERP/Shipping/Rules/Factory.php
- src/QUI/ERP/Shipping/Rules/ShippingRule.php 10 Ergänzungen, 5 Löschungensrc/QUI/ERP/Shipping/Rules/ShippingRule.php
- src/QUI/ERP/Shipping/Shipping.php 12 Ergänzungen, 9 Löschungensrc/QUI/ERP/Shipping/Shipping.php
- src/QUI/ERP/Shipping/ShippingStatus/Factory.php 2 Ergänzungen, 2 Löschungensrc/QUI/ERP/Shipping/ShippingStatus/Factory.php
- src/QUI/ERP/Shipping/ShippingStatus/Handler.php 7 Ergänzungen, 7 Löschungensrc/QUI/ERP/Shipping/ShippingStatus/Handler.php
- src/QUI/ERP/Shipping/ShippingStatus/Status.php 3 Ergänzungen, 3 Löschungensrc/QUI/ERP/Shipping/ShippingStatus/Status.php
- src/QUI/ERP/Shipping/ShippingStatus/StatusUnknown.php 1 Ergänzung, 1 Löschungsrc/QUI/ERP/Shipping/ShippingStatus/StatusUnknown.php
- src/QUI/ERP/Shipping/Tracking/Tracking.php 1 Ergänzung, 1 Löschungsrc/QUI/ERP/Shipping/Tracking/Tracking.php