Product Price Calculator
PHP 5.6+ library to make working with products and price calculation, easier, and fun!, (*1)
``` php
<?php, (*2)
use Model\Factory\MoneyFactory;
use Model\Percentage;
use Product\Product;
use Product\ProductPriceCalculator;
use Tax\TaxCollection;
use Tax\TaxRate;, (*3)
$calculator = new ProductPriceCalculator(TaxCollection::make([
TaxRate::fromPercentage(20)
]));, (*4)
$product = Product::create(
'Item Name',
MoneyFactory::create(50, 'GBP'),
Percentage::fromDecimal(0.5)
);, (*5)
$calculatedAmount = $calculator->calculatePriceFromProduct($product);, (*6)
## Install
Via Composer
``` bash
$ composer require cysha/product-price-calculator
Features
- Todo
Documentation
- Todo
Testing
We try to follow BDD and TDD, as such we use both phpspec and phpunit to test this library., (*7)
bash
$ composer test
, (*8)
Contributing
- Todo
License
The MIT License (MIT). Please see License File for more information., (*9)
Acknowledgements
- Todo