承接 labrodev/time-converter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

labrodev/time-converter

最新稳定版本:v1.0.0

Composer 安装命令:

composer require labrodev/time-converter

包简介

Utility library that provides a lightweight method to calculate the great-circle distance between two geographic coordinates using the Haversine formula.

README 文档

README

Labrodev\TimeConverter is a strict PHP 8.1+ utility library that provides static helper methods to convert between seconds, minutes, and hours — built for simplicity and performance.

Features

  • Convert seconds to minutes
  • Convert hours and minutes into raw minute count
  • Convert float-based minutes into integer format
  • Convert hours (as float) into total minutes
  • Fully static and type-safe class
  • Lightweight, dependency-free implementation
  • Includes PHPUnit and PHPStan support for testing and analysis

Installation

composer require labrodev/time-converter

Usage

use Labrodev\TimeConverter\Converter;

// Convert seconds to minutes
Converter::secondsToMinutes(180); // 3.0

// Convert hours and minutes to raw minutes
Converter::timeToRawMinutes(2, 30); // 150

// Convert float minutes to integer
Converter::floatMinutesToInt(12.7); // 13

// Convert hours to minutes
Converter::hoursToMinutes(1.5); // 90

Testing

To run tests:

composer install
composer test

Static Analysis

To run static analysis using PHPStan:

composer install
composer analyse

Configuration is located in phpstan.neon.dist

Security

If you discover a security vulnerability within this package, please contact us immediately at contact@labrodev.com. All security-related issues will be handled privately and promptly.

Credits

This package is maintained by Labrodev — Laravel & PHP development studio.
https://github.com/labrodev

Feedback

If you have any questions, suggestions, or have found an error — feel free to open an issue or contact us:
contact@labrodev.com

License: MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-29