gecleanme/xkunverio 问题修复 & 功能扩展

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

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

gecleanme/xkunverio

最新稳定版本:2.1.2

Composer 安装命令:

composer require gecleanme/xkunverio

包简介

Unit Conversions made a breeze

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Zero-dependency, slim Laravel package to convert between different units with ease

Installation

You can install the package via composer:

composer require gecleanme/xkunverio

Usage

// use the designated Conversion Type Class & its corresponding Enum following the naming pattern :
//"X{ConversionType}" & "X{ConversionType}Unit" for the Enum

use gecleanme\Xkunverio\Enums\XLengthUnit;
use gecleanme\Xkunverio\XLength;

// Invoke the 'convert' method with the "unit from", "unit to" and the measurement value then call
// get()

// Convert one Kilometer to Meters
XLength::convert(XLengthUnit::Kilometer, XLengthUnit::Meter, 1)
    ->get(); //1000.0

Testing

composer test

Supported Length Units

  • Meter
  • Kilometer
  • Mile
  • Yard
  • Centimeter
  • Inch
  • Feet
  • Millimeter

Supported Area Units

  • Square Inches
  • Square Feet
  • Square Yards
  • Square Miles
  • Square Millimeter
  • Square Centimeter
  • Square Meters
  • Square Kilometers

Supported Mass Units

  • Kilograms
  • Ounces
  • Pounds
  • Stones
  • Long Tonnes
  • Short Tonnes
  • Milligrams
  • Grams
  • Metric Tonnes

Supported Speed Units

  • Meters Per Second
  • Kilometers Per Hour
  • Miles Per Hour
  • Knots

Supported Temperature Units

  • Celsius
  • Fahrenheit
  • Kelvin

Supported Volume Units

  • Cubic Inches
  • Cubic Feet
  • Cubic Centimeters
  • Milliliters
  • Cubic Meters
  • Imperial Gallons
  • Imperial Quarts
  • Imperial Pints
  • Imperial Cups
  • Imperial Ounces
  • Imperial Tablespoons
  • Imperial Teaspoons
  • Liters

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Report them by Emailing me

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-01