PHPackages                             johnatas-x/php-assumptions - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. johnatas-x/php-assumptions

ActiveLibrary[Testing &amp; Quality](/categories/testing)

johnatas-x/php-assumptions
==========================

Static code analysis tool to detect weak assumptions

0.9.0(1y ago)0397MITPHP

Since Feb 7Pushed 1y agoCompare

[ Source](https://github.com/johnatas-x/php-assumptions)[ Packagist](https://packagist.org/packages/johnatas-x/php-assumptions)[ RSS](/packages/johnatas-x-php-assumptions/feed)WikiDiscussions master Synced 1mo ago

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

PHP Assumptions
===============

[](#php-assumptions)

[![Build Status](https://camo.githubusercontent.com/6bb61c1ec2bd5b7c4238a66ad0f01ddf1cd5391a69260169174409c01b609a4c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72736b7569706572732f7068702d617373756d7074696f6e732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rskuipers/php-assumptions/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/62f73b8ba325e1e63117dcd7d7f8ff5d49bfd79bb8e9a05c2d7abbccae1e30bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72736b7569706572732f7068702d617373756d7074696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rskuipers/php-assumptions/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/158efe7fde49a008fe2a0f75c71e0a5479855a2de85fe25bdd063a7545cf460a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72736b7569706572732f7068702d617373756d7074696f6e732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rskuipers/php-assumptions/?branch=master)

Setup
-----

[](#setup)

```
$ composer require --dev rskuipers/php-assumptions
```

Introduction
------------

[](#introduction)

PHP Assumptions is the result of a proof of concept inspired by the "[From assumptions to assertions](http://rskuipers.com/entry/from-assumptions-to-assertions)" blog post. It's a static code analysis tool doing checks for weak assumptions.

This is an example of an **assumption**:

```
if ($user !== null) {
    $user->logout();
}
```

Running `bin/phpa` on this file would yield the following output:

```
----------------------------------------------
| file        | line | message               |
==============================================
| example.php | 3    | if ($user !== null) { |
----------------------------------------------

1 out of 1 boolean expressions are assumptions (100%)

```

This is an example of an **assertion**:

```
if ($user instanceof User) {
    $user->logout();
}
```

Tests
-----

[](#tests)

This project is built with [PHPUnit](https://github.com/sebastianbergmann/phpunit) and [Prophecy](https://github.com/phpspec/prophecy-phpunit). In order to run these tests make sure you have dev dependencies installed with composer.

Running PHPUnit:

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance44

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

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

460d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb82429ffeb7556ffee9014525e0ba5d3a32cf3a525d6a5e48135ccd50626925?d=identicon)[johnatas-x](/maintainers/johnatas-x)

---

Top Contributors

[![rskuipers](https://avatars.githubusercontent.com/u/1918518?v=4)](https://github.com/rskuipers "rskuipers (40 commits)")[![mallardduck](https://avatars.githubusercontent.com/u/619938?v=4)](https://github.com/mallardduck "mallardduck (6 commits)")[![dennisdegreef](https://avatars.githubusercontent.com/u/361905?v=4)](https://github.com/dennisdegreef "dennisdegreef (4 commits)")[![nstapelbroek](https://avatars.githubusercontent.com/u/3368018?v=4)](https://github.com/nstapelbroek "nstapelbroek (2 commits)")[![segrax](https://avatars.githubusercontent.com/u/1327406?v=4)](https://github.com/segrax "segrax (2 commits)")[![MetalArend](https://avatars.githubusercontent.com/u/1175661?v=4)](https://github.com/MetalArend "MetalArend (1 commits)")[![MacFJA](https://avatars.githubusercontent.com/u/1475671?v=4)](https://github.com/MacFJA "MacFJA (1 commits)")[![vpassapera](https://avatars.githubusercontent.com/u/1493758?v=4)](https://github.com/vpassapera "vpassapera (1 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (1 commits)")[![niconoe-](https://avatars.githubusercontent.com/u/9560327?v=4)](https://github.com/niconoe- "niconoe- (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/johnatas-x-php-assumptions/health.svg)

```
[![Health](https://phpackages.com/badges/johnatas-x-php-assumptions/health.svg)](https://phpackages.com/packages/johnatas-x-php-assumptions)
```

###  Alternatives

[phpunit/php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

8.9k892.4M1.5k](/packages/phpunit-php-code-coverage)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[sebastian/complexity

Library for calculating the complexity of PHP code units

1.3k528.8M12](/packages/sebastian-complexity)[sebastian/lines-of-code

Library for counting the lines of code in PHP source code

1.2k528.9M13](/packages/sebastian-lines-of-code)

PHPackages © 2026

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