labrodev/haversine 问题修复 & 功能扩展

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

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

labrodev/haversine

最新稳定版本:v1.0.1

Composer 安装命令:

composer require labrodev/haversine

包简介

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

README 文档

README

Labrodev\Haversine is a strict PHP 8.1+ utility library that provides a lightweight method to calculate the great-circle distance between two geographic coordinates using the Haversine formula.

Features

  • Calculates accurate distance between two latitude/longitude points
  • Returns result in kilometers
  • Based on the Haversine formula (spherical Earth model)
  • Fully static and type-safe class
  • Lightweight, dependency-free implementation
  • Includes PHPUnit and PHPStan support for testing and analysis

Installation

composer require labrodev/haversine

Usage

use Labrodev\Haversine\Calculator;

// Distance in kilometers between Paris and Frankfurt
$distance = Calculator::haversineDistance(48.8566, 2.3522, 50.1109, 8.6821);

echo $distance; // e.g., 478.5 

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

统计信息

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

GitHub 信息

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

其他信息

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