PHPackages                             joaofigueira/primes - 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. joaofigueira/primes

ActiveLibrary

joaofigueira/primes
===================

prime numbers

v1.0.0(8y ago)094MITPHP

Since May 26Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Primes
======

[](#primes)

### Prime number operations

[](#prime-number-operations)

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

[](#installation)

```
composer require joaofigueira/primes

```

Usage
-----

[](#usage)

#### Check if a number is prime

[](#check-if-a-number-is-prime)

```
$number = new Primes(5);
if ($number->iPrime()){
	// do stuff
}

```

#### Check several numbers for primes

[](#check-several-numbers-for-primes)

```
$numbers = new Primes([4,5,6]);
if ($numbers[5]['isPrime']){
	// do stuff
}

```

#### List factors of one or more numbers

[](#list-factors-of-one-or-more-numbers)

```
$number = new Primes;
$number->checkIf(4)->isPrime();
print_r($number->showFactors());
// [4,2,1]

```

#### Count the factors

[](#count-the-factors)

```
$number = new Primes;
$number->checkIf(4)->isPrime();
echo $number->countFactors();
// 3

```

#### List prime numbers in an interval

[](#list-prime-numbers-in-an-interval)

```
$primes = new Primes;
print_r($primes->giveMePrimesBetween(1,10));
// [2,3,5,7]

```

#### Return the result in json format

[](#return-the-result-in-json-format)

```
$number = new Primes;
$number->checkIf(4)->isPrime();
echo $number->showFactors()->asJson();

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

3269d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07f0deaa03f529a3369db0b2c75d63c6db0c8d6bc7f6e07be7a67d248c7437ef?d=identicon)[joaopfigueira](/maintainers/joaopfigueira)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joaofigueira-primes/health.svg)

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

PHPackages © 2026

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