xynnn/unicorn 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xynnn/unicorn

Composer 安装命令:

composer require xynnn/unicorn

包简介

A framework agnostic PHP library to convert several units

README 文档

README

Code Coverage Build Status Scrutinizer Code Quality License

Unicorn Logo

A PHP based framework agnostic library to convert several units

Documentation

http://unicorn.readthedocs.io

Conversion example

Here is a quick example that shows how to convert 110 centimeters to meters:

$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:

composer require xynnn/unicorn

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

Authors

Philipp Bräutigam

Steffen Brand

License

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GNU
  • 更新时间: 2016-11-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固