PhpUnitsOfMeasure / php-units-of-measure

A library for handling physical quantities and the units of measure in which they're represented.
MIT License
305 stars 77 forks source link

PhysicalQuantity interface change #48

Closed tlode closed 8 years ago

tlode commented 9 years ago

Inspired from issue #35 (2.+ 3.) this PR proposes changes to the interface of PhysicalQuantity

The interface PhysicalQuantityInterface is renamed into PhysicalQuantity, which emphasizes more on being a type rather than being an interface (e.g. when being used in type hints).

Methods PhysicalQuantity::toUnit() and PhysicalQuantity::toNativeUnit() now return new PhysicalQuantity instances.

This PR also adds the missing scalar getter methods getValue() and getUnit(), which return the original value and the unit when the instance was created. Therefor the static method AbstractPhysicalQuantity::getUnit() has to be renamed to getUnitByNameOrAlias.

Finally, removes the non-existant submodule "vagrant" https://github.com/triplepoint/quick-vagrant.git.

soyuka commented 8 years ago

This looks great @triplepoint will you consider merging?