-
-
Notifications
You must be signed in to change notification settings - Fork 452
Replace Zend_Measure with php-units-of-measure
#5102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the Zend_Measure library with the php-units-of-measure library for unit conversion functionality. This is part of modernizing dependencies and moving away from Zend Framework components.
Key Changes:
- Adds
php-units-of-measurev2.2.0 as a new dependency - Introduces new helper classes with measurement unit constants
- Refactors unit conversion methods to use the new library's API
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| composer.json | Adds php-units-of-measure dependency |
| composer.lock | Includes the new library metadata |
| app/code/core/Mage/Core/Helper/Measure/Weight.php | New helper class defining weight unit constants |
| app/code/core/Mage/Core/Helper/Measure/Length.php | New helper class defining length unit constants |
| app/code/core/Mage/Usa/Helper/Data.php | Refactored conversion methods to use new library API |
| app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php | Updated to use new measurement constants |
| app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php | Updated to use new measurement constants |
| app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php | Updated to use new measurement constants |
| app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php | Updated to use new measurement constants |
| app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php | Updated to use new measurement constants |
| app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php | Updated to use new measurement constants |
| app/design/adminhtml/default/default/template/sales/order/shipment/packaging/popup.phtml | Updated template to use new measurement constants |
| tests/unit/Mage/Usa/Helper/DataTest.php | New unit tests for conversion methods |
| tests/unit/Traits/DataProvider/Mage/Usa/Helper/DataTrait.php | New test data provider trait |
| .phpunit.dist.xml | Added Mage_Usa test suite |
| .phpstan.dist.baseline.neon | Updated baseline with new exceptions |
# Conflicts: # composer.lock
c309d62 to
991b8cb
Compare
# Conflicts: # .phpstan.dist.baseline.neon # app/code/core/Mage/Usa/Helper/Data.php
# Conflicts: # .phpstan.dist.baseline.neon # app/code/core/Mage/Usa/Helper/Data.php
|
|
Why can't phpstan find: |
|
What do you mean? One commit was not complete, but that should be fixed. |

Uh oh!
There was an error while loading. Please reload this page.