delboy1978uk/phi
Composer 安装命令:
composer require delboy1978uk/phi
包简介
An analogue fractional calculator
README 文档
README
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-20