reusables/distance

The Distance Object

v1.0.0 2015-04-02 07:21 UTC

This package is not auto-updated.

Last update: 2025-06-21 20:04:55 UTC


README

The Distance Object.

Build Status Coverage Status

Install

composer require reusables/distance

Usage

<?php

use \Reusables\Unit\Distance;

// instantiate
$distance = new Distance(36, Distance::INCHES);

// convert
$feet = $distance->to(Distance::FEET)->value(); // 3 (FEET)

// add
$inches = $distance->add(new Distance(1, Distance::FEET))->value(); // 48 (INCHES)

See docblocks for more details.

License

This library is available under a MIT license.