cysha / product-price-calculator
一个简单的包,用于帮助计算产品价格
0.1.2
2017-05-21 01:53 UTC
Requires
- beberlei/assert: ^2.6
- moneyphp/money: ^3.0
- tightenco/collect: ^5.3
Requires (Dev)
- phpspec/phpspec: ^3.2
This package is not auto-updated.
Last update: 2024-09-28 20:30:31 UTC
README
PHP 5.6+ 库,使处理产品和价格计算变得更容易、更有趣!
<?php use Model\Factory\MoneyFactory; use Model\Percentage; use Product\Product; use Product\ProductPriceCalculator; use Tax\TaxCollection; use Tax\TaxRate; $calculator = new ProductPriceCalculator(TaxCollection::make([ TaxRate::fromPercentage(20) ])); $product = Product::create( 'Item Name', MoneyFactory::create(50, 'GBP'), Percentage::fromDecimal(0.5) ); $calculatedAmount = $calculator->calculatePriceFromProduct($product);
安装
通过Composer
$ composer require cysha/product-price-calculator
特性
- Todo
文档
- Todo
测试
我们尽量遵循BDD和TDD,因此我们同时使用phpspec和phpunit来测试这个库。
$ composer test
贡献
- Todo
许可
MIT 许可证(MIT)。请参阅许可文件获取更多信息。
致谢
- Todo