PHPackages                             cyrulik/simple-calculator - 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. cyrulik/simple-calculator

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

cyrulik/simple-calculator
=========================

A simple calculator implementation with basic functionality.

1.0.0(1y ago)04MITPHPPHP ^8.3

Since Jan 20Pushed 1y ago1 watchersCompare

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

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

Simple Calculator
=================

[](#simple-calculator)

This is a simple calculator that can perform basic arithmetic operations.

It is written as a reusable package in PHP 8.3 and uses PHPUnit 10 for testing.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require cyrulik/simple-calculator
```

Usage
-----

[](#usage)

```
use Cyrulik\SimpleCalculator\Calculator;
use Cyrulik\SimpleCalculator\OperationFactory;

$calculator = new Calculator(new OperationFactory());
$calculator->calculate('addition', 1, 2);
```

Working with this project
-------------------------

[](#working-with-this-project)

Simple Calculator uses Makefile to run every aspect required for development of this project.

Specific commands and their equivalent composer scripts are listed below. All of them have their equivalent make commands, e.g. `composer test` can be run with `make test`.

Installation
------------

[](#installation-1)

To start working with this project, and when changing any of its files later, you can run all major checks with:

```
make all
```

Testing
-------

[](#testing)

This project uses PHPUnit for testing. You can run tests with:

```
composer test
```

Or directly with PHPUnit:

```
./vendor/bin/phpunit
```

Coverage
--------

[](#coverage)

To generate coverage report, you need to have Xdebug installed. You can generate coverage report with:

```
XDEBUG_MODE=coverage composer test-coverage
```

Coding Standards
----------------

[](#coding-standards)

Simple Calculator uses PHP CS Fixer to enforce coding standards. You can fix coding standards with:

```
composer fix
```

Or directly with PHP CS Fixer:

```
./vendor/bin/php-cs-fixer fix
```

Static Analysis
---------------

[](#static-analysis)

PHPStan is used for static analysis. You can run static analysis with:

```
composer analyse
```

Or directly with PHPStan:

```
./vendor/bin/phpstan analyse
```

Infection
---------

[](#infection)

Infection is used for mutation testing. You can run mutation testing with:

```
composer infection
```

Or directly with Infection:

```
./vendor/bin/infection
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

477d ago

### Community

Maintainers

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

---

Top Contributors

[![cyrulik](https://avatars.githubusercontent.com/u/3313071?v=4)](https://github.com/cyrulik "cyrulik (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cyrulik-simple-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/cyrulik-simple-calculator/health.svg)](https://phpackages.com/packages/cyrulik-simple-calculator)
```

###  Alternatives

[cleaniquecoders/shrinkr

Shrinkr is a Laravel package for shortening URLs, with custom slugs, analytics, branded domains, and seamless API integration.

142.9k](/packages/cleaniquecoders-shrinkr)

PHPackages © 2026

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