hereldar / 日期时间
提供日期、时间、时区和周期的不变类。
0.3.0
2024-03-15 15:45 UTC
Requires
- php: ^8.1.17|^8.2.4|^8.3.0
- hereldar/results: ^0.9
Requires (Dev)
- hereldar/coding-style: ^0.1.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.1
- psalm/plugin-phpunit: ^0.18.4
- vimeo/psalm: ^5.23.0
README
此库包括代表主要日期时间概念的几个类,包括日期、时间、时区和周期。
LocalDate::now()->minus(weeks: 1)->atTime(LocalTime::noon())->toIso8601();
亮点
- 概念分离
- 不可变性
- 类型安全
- 内聚性
安装
通过Composer
composer require hereldar/date-times
开发
从项目文件夹中运行以下命令
make tests make static-analysis make coding-standards
执行
- 一个PHPUnit 测试套件。
- PHPStan 和 Psalm 用于静态代码分析。
- Easy Coding Standard 用于修复编码规范。
文档
致谢
许可证
MIT许可证(MIT)。请参阅LICENSE 获取更多信息。