PHPackages                             ecommit/scalar-values - 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. ecommit/scalar-values

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

ecommit/scalar-values
=====================

Test scalar values.

v1.3.1(4w ago)015.4k↑420%1MITPHPPHP ^8.1CI passing

Since Apr 14Pushed 4w ago1 watchersCompare

[ Source](https://github.com/e-commit/scalar-values)[ Packagist](https://packagist.org/packages/ecommit/scalar-values)[ RSS](/packages/ecommit-scalar-values/feed)WikiDiscussions master Synced yesterday

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

Scalar Values Tools
===================

[](#scalar-values-tools)

[![Tests](https://github.com/e-commit/scalar-values/workflows/Tests/badge.svg)](https://github.com/e-commit/scalar-values/workflows/Tests/badge.svg)

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

[](#installation)

To install scalar-values with Composer just run :

```
$ composer require ecommit/scalar-values
```

Usage
-----

[](#usage)

Test if an array contains only scalar values :

```
use Ecommit\ScalarValues\ScalarValues;

$array = ['str1', 2, 3];
if (ScalarValues::containsOnlyScalarValues($array)) { //True
    //...
} else {
    //...
}

$array = ['str1', ['tab'], 3];
if (ScalarValues::containsOnlyScalarValues($array)) { //False
    //...
} else {
    //...
}
```

Returns the input array after deleting all non-scalar values (on root):

```
use Ecommit\ScalarValues\ScalarValues;

$array = ['str1', ['tab'], 3];
$newArray = ScalarValues::filterScalarValues($array); //[0 => 'str1', 2 => 3]
```

License
-------

[](#license)

This librairy is under the MIT license. See the complete license in *LICENSE* file.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity70

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

Every ~320 days

Recently: every ~373 days

Total

8

Last Release

29d ago

PHP version history (4 changes)v1.0.0PHP ^7.2

v1.0.1PHP ^7.2|^8.0

v1.1.0PHP ^7.4|^8.0

v1.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/73191162d97fffaa1a23d23326a7a77fbaa94ce41e49cf4ee6cbf0b9c9800c80?d=identicon)[e-commit](/maintainers/e-commit)

---

Top Contributors

[![hlecorche](https://avatars.githubusercontent.com/u/188749?v=4)](https://github.com/hlecorche "hlecorche (48 commits)")

---

Tags

phpscalar-valuesvaluesscalar

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ecommit-scalar-values/health.svg)

```
[![Health](https://phpackages.com/badges/ecommit-scalar-values/health.svg)](https://phpackages.com/packages/ecommit-scalar-values)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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