PHPackages                             fykosak/nette-fks-utils - 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. fykosak/nette-fks-utils

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

fykosak/nette-fks-utils
=======================

v0.2.0(3y ago)068.8k1GPL-3.0-or-laterPHPPHP 8.1.\*CI passing

Since Jun 20Pushed 4mo ago5 watchersCompare

[ Source](https://github.com/fykosak/nette-fks-utils)[ Packagist](https://packagist.org/packages/fykosak/nette-fks-utils)[ RSS](/packages/fykosak-nette-fks-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (18)Used By (1)

FKS utils for nette
===================

[](#fks-utils-for-nette)

[![Lines of code](https://camo.githubusercontent.com/aadc38d7d59016d8fad4491ebabb7420d07468ce2f394dbbaec82aca5134fece/68747470733a2f2f696d672e736869656c64732e696f2f746f6b65692f6c696e65732f6769746875622f66796b6f73616b2f6e657474652d666b732d7574696c73)](https://camo.githubusercontent.com/aadc38d7d59016d8fad4491ebabb7420d07468ce2f394dbbaec82aca5134fece/68747470733a2f2f696d672e736869656c64732e696f2f746f6b65692f6c696e65732f6769746875622f66796b6f73616b2f6e657474652d666b732d7574696c73)[![PHP](https://github.com/fykosak/nette-fks-utils/actions/workflows/php.yml/badge.svg)](https://github.com/fykosak/nette-fks-utils/actions/workflows/php.yml/badge.svg)[![PSR-12](https://github.com/fykosak/nette-fks-utils/actions/workflows/php-psr.yml/badge.svg)](https://github.com/fykosak/nette-fks-utils/actions/workflows/php-psr.yml/badge.svg)

Currency &amp; Price
--------------------

[](#currency--price)

### Currency.php

[](#currencyphp)

Something like enum :) Methods `cases`, `tryFrom`, `from` and property `value` similar like enum(PHP8.1). Implemented is only `EUR` and `CZK`.

To format amount use method `format(float $amount):string`

### Price.php

[](#pricephp)

Representation of single currency price. Currency is passed as required parameter of constructor and can not be changed. If amount is not present in constructor, will be set to `0.0`. To modify amount use method `add`, to substrate use `add` with negative amount.

```
$price = new Price(Currency::from(Currency::CZK), 4.5);
$price->add(5.0);
$price->add(-4.0);
$price->getAmount(); // return 5.5
$price->getCurrency();// return Currency object with value 'czk'
```

Method `__toString` is only delegate to `Currency::format()`.

### MultiCurrencyPrice

[](#multicurrencyprice)

Represent container for price in more Currencies at the same time.

#### Base usage

[](#base-usage)

```
$multiPrice = new MultiCurrencyPrice([new Price(Currency::from(Currency::CZK), 4)]); // Create container with only CZK price and amout 4.0 CZK
$multiPrice->czk; // Price can be access wia magic __get, an key is ISO 4217 3char code and return Price object
$multiPrice->eur; // Throw \OutOfRangeException, Price in EUR is not set

$multiPrice->czk = new Price(Currency::from(Currency::CZK)); // via magic __set can be set price
$multiPrice->czk = new Price(Currency::from(Currency::EUR)); // thow exception currecies muss be same

$multiPrice->eur = new Price(Currency::from(Currency::EUR)); // thow exception because EUR price is not present, only curencies registred in contructor can be used
```

#### Operation add

[](#operation-add)

```
$multiPrice1 = new MultiCurrencyPrice([
    new Price(Currency::from(Currency::CZK), 2),
]);
$multiPrice2 = new MultiCurrencyPrice([
    new Price(Currency::from(Currency::CZK), 1),
    new Price(Currency::from(Currency::EUR), 4),
]);

$multiPrice1->add($multiPrice2); // can be added because curencies of $multiprice1 is a subset of $multiprice2
$multiPrice1->eur; // but still thow exception and not added a new currency
$multiPrice1->czk->getAmount(); // is 3.0 call add on Prices

$multiPrice2->add($multiPrice1); // thow exeption because $multiprice1 no contains eur, so $multiprice2 is not a subset of the $multiprice1
```

BaseComponent
-------------

[](#basecomponent)

BaseComponent represent nette `Nette\Application\UI\Control` with possibility use nette/DI inject like in Presenters.

```
class MyComponent extends \Fykosak\Utils\BaseComponent\BaseComponent
{
    private MyService $myService;
    public function injectMyService(MyService $myService):void
    {
        $this->myService = $myService; // works with BaseComponent in components too ;)
    }
}
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance51

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~82 days

Recently: every ~1 days

Total

16

Last Release

556d ago

PHP version history (4 changes)v0.0.2PHP &gt;=7.4

v0.1.0-RC1PHP 7.4.\* | 8.0.\* | 8.1.\*

v0.2.0PHP 8.1.\*

v0.2.1.0-RC6PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/294f067cd88f08a0a23ce41dc09432ddf9fea704006f542525a6dc2ad5633186?d=identicon)[cevro\_o](/maintainers/cevro_o)

---

Top Contributors

[![cevro](https://avatars.githubusercontent.com/u/10603313?v=4)](https://github.com/cevro "cevro (124 commits)")[![Headary](https://avatars.githubusercontent.com/u/41702931?v=4)](https://github.com/Headary "Headary (7 commits)")[![vercah](https://avatars.githubusercontent.com/u/62338376?v=4)](https://github.com/vercah "vercah (2 commits)")

---

Tags

nettephputils-library

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/fykosak-nette-fks-utils/health.svg)

```
[![Health](https://phpackages.com/badges/fykosak-nette-fks-utils/health.svg)](https://phpackages.com/packages/fykosak-nette-fks-utils)
```

###  Alternatives

[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

881.7M6](/packages/nette-code-checker)[contributte/menu-control

Menu control for Nette framework

29108.6k1](/packages/contributte-menu-control)[uestla/twigrid

Experimental DataGrid for Nette Framework

1712.3k2](/packages/uestla-twigrid)[ipub/gravatar

Gravatar creator for Nette Framework

122.0k1](/packages/ipub-gravatar)

PHPackages © 2026

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