定制 clsasc/equivalent-time 二次开发

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

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

clsasc/equivalent-time

Composer 安装命令:

composer require clsasc/equivalent-time

包简介

A class based implementation of the British Swimming/SPORTSYSTEMS Equivalent Time Algorithm.

README 文档

README

A class based implementation of the British Swimming/SPORTSYSTEMS Equivalent Time Algorithm. Written in-house by Chester-le-Street ASC.

Basic Usage

  1. Install via composer
composer require clsasc/equivalent-time
  1. From there, create an EquivalentTime Object in your project
use CLSASC\EquivalentTime\EquivalentTime;
$object = new EquivalentTime("25m", "200 Free", 116.68);

Parameter 1 is the length of the source pool, Parameter 2 is the event and Parameter 3 is the time, formatted as a float, seconds.hundreds - You may wish to cast this to a float, just in case your code takes in time as a string.

  1. Choose if you want the output to be formatted as a string or a float. Float output is default, but you can get it as an 'alpha format' (MM:SS:H) string by invoking the setOutputAsString(); method on your object. Switch back by calling the setOutputAsReal(); method on your object.

  2. Get your output. PHP $object->getConversion("50m"); Where the parameter is the length of pool you would like your time to be converted to.

  3. You can call the getConversion($length) method on your conversion object as many times as you wish. To convert another time, create a new object and the old one will be garbage collected by PHP after it is no longer referenced.

Documentation

Full API Style documentation is available (phpDocumentor).

Accepted Source Pool Lengths

Source Pool Length names are shown as they should be entered as a string to the converter object.

The same strings as listed below should be used when calling a method to obtain a converted time, though you should always try {...} catch (Exception ...) {...} when calling the method as if the event cannot be swum in the distance you have requested, the converter will throw an exception to alert you to the problem.

  • 20m
  • 25m
  • 33 1/3m
  • 50m
  • 20y
  • 25y
  • 26 2/3y
  • 27 1/2y
  • 33 1/3y

Accepted Events

Below is a list of events accepted by the time converter. Some events are only accepted for a subset of source pool lengths, described by the list following the event name. If you do try to create an object with an event and source pool length which are incompatible, an exception will be thrown, which you should catch....

Event names are shown as they should be entered as a string to the converter object.

  • 50 Free is allowed with the following source pool lengths;
    • 50m
    • 25m
    • 27 1/2y
    • 25y
  • 100 Free
  • 200 Free
  • 400 Free
  • 800 Free
  • 1500 Free is not allowed with the following source pool lengths;
    • 33 1/3y
    • 20y
  • 50 Breast is allowed with the following source pool lengths;
    • 50m
    • 25m
    • 27 1/2y
    • 25y
  • 100 Breast
  • 200 Breast
  • 50 Fly is allowed with the following source pool lengths;
    • 50m
    • 25m
    • 27 1/2y
    • 25y
  • 100 Fly
  • 200 Fly
  • 50 Back is allowed with the following source pool lengths;
    • 50m
    • 25m
    • 27 1/2y
    • 25y
  • 100 Back
  • 200 Back
  • 200 IM
  • 400 IM

Exceptions

The system will throw exceptions for error conditions. Please read the docs for full details on these.

clsasc/equivalent-time 适用场景与选型建议

clsasc/equivalent-time 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.05k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 clsasc/equivalent-time 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-08-25