定制 delboy1978uk/phi 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

delboy1978uk/phi

Composer 安装命令:

composer require delboy1978uk/phi

包简介

An analogue fractional calculator

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality
Floats suck. So lets make an analogue fractional calculator. Join in!

v0.0.5

Refactoring fractions (apparently) works! We might need more test cases. Help us add some!

install the project

First fork the project on GitHub. Then,

git clone https://github.com/your-github-name/phi
cd phi
composer install

run the tests

codecept run unit --coverage-html

Or you can log into https://travis-ci.org/ and hook up your forked repository. Then by git pushing the tests will run.

do your thing

You either build, break, or fix. Get the test passing, or add a new set of data which will make the tests fail.

new feature

We have a setNegative($bool) method for negative fractions. We haven't added any test cases for that, so why not join in the fun? :-)

adding a test case

In tests/unit/Phi/PhiTest.php you can see the testToString() test. There is a dataset, each being an array with four values; the whole, the numerator, the denominator, and the expected string output. Contributing can be as simple as throwing some numbers in there and try to break the class!

send your pull request

Because contributing to open source is fun!

usage

Right now, there is only one class, Del\Phi\Fraction. An object representing a fraction, comprising of a whole number, and fractional numerator and denominator.

<?php 

use Del\Phi\Fraction;

$phi = new Fraction();
$phi->setWhole(3)
    ->setNumerator(3)
    ->setDenominator(4);

echo $phi->toDecimal(); // float 3.75
echo $phi;              // string '3 3/4'

More functionality will be made soon, but first we need tests which will break the current logic and give us unexpected output! (for example '3 3/3' should really output 4)

delboy1978uk/phi 适用场景与选型建议

delboy1978uk/phi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 10 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 delboy1978uk/phi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 delboy1978uk/phi 我们能提供哪些服务?
定制开发 / 二次开发

基于 delboy1978uk/phi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-20