PHPackages                             feriatos/sigma-test-task - 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. feriatos/sigma-test-task

ActiveLibrary

feriatos/sigma-test-task
========================

Test task for Sigma Software

v0.0.1(5y ago)05MITPHPPHP &gt;=7.2.0CI failing

Since May 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/feriatos/sigma-test-task)[ Packagist](https://packagist.org/packages/feriatos/sigma-test-task)[ Docs](https://github.com/feriatos/sigma-test-task)[ RSS](/packages/feriatos-sigma-test-task/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Test task for Sigma Software
============================

[](#test-task-for-sigma-software)

This library allows to create a POS Terminal and count a price for a shopping cart depending on different pricing strategies.

How to install
--------------

[](#how-to-install)

```
composer require "feriatos/sigma-test-task:*"

```

How to use
----------

[](#how-to-use)

First create pricing strategies and add products:

```
$pricing = new OneTierPricing();
$pricing->addProduct(new OneTierProduct('ZA', 2, 7, 4));
$pricing->addProduct(new OneTierProduct('YB', 12));
$pricing->addProduct(new OneTierProduct('FC', 1.25, 6, 6));
$pricing->addProduct(new OneTierProduct('GD', 0.15));
```

Then create a terminal and set pricing:

```
$terminal = new POSTerminal();
$terminal->setPricing($pricing);
```

Scan items:

```
$terminal->scanItem('ZA');
$terminal->scanItem('YB');
$terminal->scanItem('FC');
$terminal->scanItem('GD');
$terminal->scanItem('ZA');
$terminal->scanItem('YB');
$terminal->scanItem('ZA');
$terminal->scanItem('ZA');
```

And get a result:

```
$totalPrice = $terminal->getTotal();
```

To clean items call:

```
$terminal->resetItems();
```

How to extend
-------------

[](#how-to-extend)

This library utilizes Strategy design patter. You could extend it just implementing `PricingInterface` and `ProductInterface` and add your own pricing strategy (for example two or three tiers pricing strategy).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2182d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eaf084dd69099754520c2cfd42c82ec1f3815704e8ff61ecfc732e4c9fcf30f7?d=identicon)[feriatos](/maintainers/feriatos)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/feriatos-sigma-test-task/health.svg)

```
[![Health](https://phpackages.com/badges/feriatos-sigma-test-task/health.svg)](https://phpackages.com/packages/feriatos-sigma-test-task)
```

PHPackages © 2026

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