PHPackages                             minehub/prerequisites - 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. minehub/prerequisites

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

minehub/prerequisites
=====================

Library for evaluating prerequisities

1.0.0(3y ago)148MITPHP

Since Feb 8Pushed 3y agoCompare

[ Source](https://github.com/MineHubCZ/prerequisites)[ Packagist](https://packagist.org/packages/minehub/prerequisites)[ RSS](/packages/minehub-prerequisites/feed)WikiDiscussions master Synced 1mo ago

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

Prerequisities
==============

[](#prerequisities)

Library for evaluating prerequisites writen in simple infix language.

Documentation
-------------

[](#documentation)

### About

[](#about)

This library evaluates simple c-like logical expressions with given variables. It was made for MineHub academys prerequisites.

### Syntax

[](#syntax)

As previously mentioned, it uses c-like logical expression syntax.

#### Variables

[](#variables)

Variable names can contain every character except those: `()|&! ` - these are reserved for other syntax. Variables can be only boolean and will be loaded from eval function. See [evaluation](#evaluation)

In examples we would use true and false to make it simpler, but you can use any variable name you want, as long as it doesn't contain reserved words.

#### Operators

[](#operators)

You can use operators or (`||`) with and (`&&`), where and has bigger priority, meaning that

```
true || true && false
```

would evaluate as `true`, instead of `false`.

#### Groups

[](#groups)

To change priority, you can use groups (just put it in brackets). So this

```
(true || false ) && false
```

would evaluate as `false`

#### Negation

[](#negation)

We can also negate variables and groups:

```
!true
```

would evaluate as `false`, and

```
!(true || false)
```

would also evaluate as `false`.

#### Everything is expression!

[](#everything-is-expression)

Everything is expression, so you can do stuff like:

```
(true || (false || true)) && (!(true || (false || true)) && false)
```

#### Formal definition

[](#formal-definition)

TODO maybe its not correct

```
 ::= [^\s\(\)\|&!]+
 ::=
 ::= "||"
 ::= "&&"
 ::= "("")"
 ::= "!"

```

### Evaluation

[](#evaluation)

To evaluate string, simply create instance of `\MineHub\Prerequisities\Evaluator` and use `eval` method. This method takes code and array of variables:

```
$evaluator = new Evaluator();
$evaluator->eval('!(!foo || bar) && (foo && !bar)', ['foo' => true, 'bar' => false]); // returns true
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

1195d ago

### Community

Maintainers

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

---

Top Contributors

[![tenmajkl](https://avatars.githubusercontent.com/u/61601336?v=4)](https://github.com/tenmajkl "tenmajkl (6 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/minehub-prerequisites/health.svg)

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

###  Alternatives

[s-patompong/laravel-routes-html

View your Laravel routes on the browser.

264.6k](/packages/s-patompong-laravel-routes-html)

PHPackages © 2026

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