PHPackages                             dianad/math-package - 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. dianad/math-package

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

dianad/math-package
===================

php developer test case

04PHP

Since Mar 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dianadragoi35/math-package)[ Packagist](https://packagist.org/packages/dianad/math-package)[ RSS](/packages/dianad-math-package/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[Installation](https://packagist.org/packages/dianad/math-package)
==================================================================

[](#installation)

```
$ composer require dianad/math-package:dev-master
```

Usage
=====

[](#usage)

`MathPackage` Class

calcDivisors function
---------------------

[](#calcdivisors-function)

Takes an integer and returns an array with all of the integer's divisors (except for 1 and the number itself). Prime numbers are not allowed.

- param `int`
- returns `array` with divisors

calcFactorial function
----------------------

[](#calcfactorial-function)

Calculates and returns the factorial for a given input. Input below 0 and above 12 is not allowed.

- param `int`
- returns `int`

calcPrimeNumbers function
-------------------------

[](#calcprimenumbers-function)

Takes an array with integers finds the prime numbers and returns the result as a XML document which each found prime number in a ‘number’ node

- param 1 `array` with integers
- param 2 `bool` $saveXML, true for saving XML file, false for display XML
- returns result as `XML document`

isPrimeNumber function
----------------------

[](#isprimenumber-function)

Check if a number is prime

- param `int`
- returns `bool`

filterPrimes function
---------------------

[](#filterprimes-function)

Takes the prime numbers from an array of integers

- param `array` on integers
- returns `array` with primes

Example
=======

[](#example)

```

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

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.

### Community

Maintainers

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

---

Top Contributors

[![dianadragoi35](https://avatars.githubusercontent.com/u/32131649?v=4)](https://github.com/dianadragoi35 "dianadragoi35 (11 commits)")

### Embed Badge

![Health badge](/badges/dianad-math-package/health.svg)

```
[![Health](https://phpackages.com/badges/dianad-math-package/health.svg)](https://phpackages.com/packages/dianad-math-package)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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