2017-25 © Pedro Pelåez
 

library unicorn

A framework agnostic PHP library to convert several units

image

xynnn/unicorn

A framework agnostic PHP library to convert several units

  • Thursday, February 23, 2017
  • by xyNNN
  • Repository
  • 3 Watchers
  • 9 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Unicorn

Code Coverage Build Status Scrutinizer Code Quality License, (*1)

Unicorn Logo, (*2)

A PHP based framework agnostic library to convert several units, (*3)

Documentation

http://unicorn.readthedocs.io, (*4)

Conversion example

Here is a quick example that shows how to convert 110 centimeters to meters:, (*5)

$converter = new LengthConverter();

try {
    $result = $converter->convert(
        new ConvertibleValue('110', $converter::$centimeter),
        $converter::$meter
    );

    $result->getValue(); // '1.10...' with 999 decimals
    $result->getFloatValue(); // 1.1
    $result->getUnit()->getAbbreviation(); // 'm'
    $result->getUnit()->getName(); // 'meter'
} catch (UnsupportedUnitException $e) {
    // Unit might not be present in the converters units array
} catch (InvalidArgumentException $e) {
    // Something is wrong with the provided ConvertibleValue or Unit
}

Requirements

  • PHP 7.0 or higher
  • BCMath extension installed and enabled

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of unicorn:, (*6)

composer require xynnn/unicorn

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*7)

Authors

Philipp BrÀutigam, (*8)

Steffen Brand, (*9)

License

Copyright (c) 2016 Philipp BrÀutigam, Steffen Brand and contributors.
This repository is released under the GNU LGPL v3.0 license., (*10)

The Versions

23/02 2017

dev-master

9999999-dev https://github.com/xyNNN/unicorn

A framework agnostic PHP library to convert several units

  Sources   Download

GNU LGPL v3.0

The Requires

 

The Development Requires

by Steffen Brand
by Philipp BrÀutigam

converter units formats

25/01 2017

1.0.1

1.0.1.0 https://github.com/xyNNN/unicorn

A framework agnostic PHP library to convert several units

  Sources   Download

GNU LGPL v3.0

The Requires

 

The Development Requires

by Steffen Brand
by Philipp BrÀutigam

converter units formats

07/11 2016

1.0.0

1.0.0.0 https://github.com/xyNNN/unicorn

A framework agnostic PHP library to convert several units

  Sources   Download

GNU LGPL v3.0

The Requires

 

The Development Requires

by Steffen Brand
by Philipp BrÀutigam

converter units formats