PHPackages                             mibo/prices - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mibo/prices

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mibo/prices
===========

PHP lib for prices

2.0.1(2y ago)02.6k[1 PRs](https://github.com/4513/prices/pulls)1MITPHPPHP ^8.2CI passing

Since Jul 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/4513/prices)[ Packagist](https://packagist.org/packages/mibo/prices)[ RSS](/packages/mibo-prices/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (10)Used By (1)

Prices
======

[](#prices)

[![codecov](https://camo.githubusercontent.com/a9005eb5e8e8c740e6eb1961ac355cefabbb1dbd1a9d6d0e64a24d9a0fddbb0b/68747470733a2f2f636f6465636f762e696f2f67682f343531332f7072696365732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d6c6261744b4d6d4c6972)](https://codecov.io/gh/4513/prices)

The library serves a Price class that can be used to represent a price in an object that can be sold or has its value.

Goals:

- Calculating multiple prices;
- Calculating multiple prices with different currencies;
- Calculating multiple prices with different tax rates;
- Combination of any or all above.

User of this library should mainly use `\MiBo\Prices\Price` class, that comes with an implementation of `\MiBo\Prices\Contracts\PriceInterface`, or `\MiBo\Properties\Contracts\NumericalProperty`, meaning, the class follows native `add`, `subtract` methods. The `PriceInterface` extends the `NumericalProperty` Interface by adding `getValueOfVAT` and `getValueWithVAT` methods that can be used to get value of either VAT or both, VAT and the base value. The Interface then extends the `PropertyInterface` by `forCountry` method that can be used when one wants to change the VAT of the Price for a specific country.

---

### Installation

[](#installation)

```
composer require mibo/prices
```

### Usage

[](#usage)

```
$price = new \MiBo\Prices\Price(
    10,
    \MiBo\Prices\Units\Price\Currency::get("EUR"),
    \MiBo\Prices\Calculators\PriceCalc::getVATManager()->retrieveVAT($classification, 'SVK')
);
$price->getValue(); // 10
$price->getValueOfVAT(); // 2 (20% of 10 for the day of writing this)
$price->getValueWithVAT(); // 12 (10 + 2)

$price->forCountry("CZE");
$price->getValueWithVAT(); // 11.5 (10 + 1.5 for the day of writing this)
```

**NOTE:**

- Before using conversion of currencies, one must require a library that provides conversion rates. The conversion is not part of this library!
- Before using conversion of VAT rates, one must require a library that provides VAT rates. The conversion is not part of this library!

---

### Logic of the library

[](#logic-of-the-library)

This library one extends MiBo\\Properties library by a Price, using MiBo\\VAT to get VAT for the Prices, and MiBo\\Currencies for currencies - units of the Prices.

#### Calculators

[](#calculators)

**PriceCalc** class is there to calculate multiple prices, either adding them together, or subtracting them. The point is to have this process on the single place. The Calculator checks the currencies and VAT rates.

#### Price

[](#price)

The `\MiBo\Prices\Price` class, the (main) property, is a class-to-be-used by a user. One should not have a need to use another class.

---

### Changes, updates, etc.

[](#changes-updates-etc)

The library does not cover a conversion between currencies, nor VAT rates. If one wants to have that solved, check composer suggestions. If empty, the libraries that are focused on that are not yet published, however, they are under development and will be available soon.

---

### Notes

[](#notes)

Please, be aware that comparing prices is complex and should be done with care. Currently, the library does provide a way to compare prices, however, that is being marked as deprecated and experimental, even tho, it should work fine. One should make sure that the behavior is as expected, because comparing a price with VAT and currency is way too hard.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance60

Regular maintenance activity

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Recently: every ~57 days

Total

8

Last Release

743d ago

Major Versions

1.3.0 → 2.0.02023-11-05

PHP version history (2 changes)1.0.0PHP ^8.1

2.0.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0866c3280ed62cfc74feb086241ec9ee56bab89b4fa2b8c8a3dbd62508761b6a?d=identicon)[MiBo](/maintainers/MiBo)

---

Top Contributors

[![4513](https://avatars.githubusercontent.com/u/25705559?v=4)](https://github.com/4513 "4513 (41 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

phpmoneycurrencypackagelibrarymathematicsmathpropertycalculationpricesexchangepropertiesvatcurrenciesvaluepricetaxlibmathematicalMiBoExchanging

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mibo-prices/health.svg)

```
[![Health](https://phpackages.com/badges/mibo-prices/health.svg)](https://phpackages.com/packages/mibo-prices)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

41.5k328.9k1](/packages/ccxt-ccxt)[kornrunner/ccxt

A PHP cryptocurrency trading library with support for more than 90 bitcoin/altcoin exchanges

371.6k](/packages/kornrunner-ccxt)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
