PHPackages                             treetime-ca/scientist-chances-fractional - 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. treetime-ca/scientist-chances-fractional

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

treetime-ca/scientist-chances-fractional
========================================

A fractional chance class for daylerees/scientist

0.1.2(4y ago)031MITPHPPHP &gt;=7.3

Since Aug 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/TreeTime-ca/scientist-chances-fractional)[ Packagist](https://packagist.org/packages/treetime-ca/scientist-chances-fractional)[ RSS](/packages/treetime-ca-scientist-chances-fractional/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (9)Versions (4)Used By (0)

[![Scientist](scientist.png)](https://github.com/daylerees/scientist)

Scientist Fractional Chance
===========================

[](#scientist-fractional-chance)

[![Packagist Version](https://camo.githubusercontent.com/95206e253a25db1be6babcfbe79fc96e05078333b36ce85d5a339de27bf5ee28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7472656574696d652d63612f736369656e746973742d6368616e6365732d6672616374696f6e616c2e737667)](https://packagist.org/packages/treetime-ca/scientist-chances-fractional)[![Packagist](https://camo.githubusercontent.com/056a062a5dd47eea4533af60b0b643aea9583adcb23c24ce1f2e9fa02bcfaab4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7472656574696d652d63612f736369656e746973742d6368616e6365732d6672616374696f6e616c2e737667)](https://packagist.org/packages/treetime-ca/scientist-chances-fractional)

Fractional chance class for use with the [Scientist Library](http://github.com/daylerees/scientist)

1. Installation
---------------

[](#1-installation)

Require the latest version of Scientist Chances Fractional using [Composer](https://getcomposer.org/).

```
composer require treetime-ca/scientist-chances-fractional

```

2. Usage
--------

[](#2-usage)

Using FractionalChance for experiment to run only 1 out of 100 times

```
$chance = new FractionalChance();
// Setting experiment to run 1%, 1/100 times, default 1 out of value sent to setProbability
$chance->setProbability(100);
// Explicitly setting probability to 1% or 1/100 chance
$chance->setProbability(100, 1);
$experiment = (new Scientist\Laboratory)
  ->experiment('experiment title')
  ->control($controlCallback)
  ->chance($chance)
  ->trial('trial name', $trialCallback)
  ->matcher($matcher);
```

Using FractionalChance for experiment to run 33.3%, 1/3 of the time

```
$chance = new FractionalChance();
$chance->setProbability(3,1);
$experiment = (new Scientist\Laboratory)
  ->experiment('experiment title')
  ->control($controlCallback)
  ->chance($chance)
  ->trial('trial name', $trialCallback)
  ->matcher($matcher);
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Every ~3 days

Total

3

Last Release

1730d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/90357002?v=4)[Michael Best](/maintainers/mbtreetime)[@mbtreetime](https://github.com/mbtreetime)

---

Top Contributors

[![mbtreetime](https://avatars.githubusercontent.com/u/90357002?v=4)](https://github.com/mbtreetime "mbtreetime (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/treetime-ca-scientist-chances-fractional/health.svg)

```
[![Health](https://phpackages.com/badges/treetime-ca-scientist-chances-fractional/health.svg)](https://phpackages.com/packages/treetime-ca-scientist-chances-fractional)
```

PHPackages © 2026

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