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.2.0(1y ago)014.4k↑33.3%1MITPHPPHP ^8.1CI passing

Since Apr 14Pushed 3mo 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 1mo ago

READMEChangelogDependencies (3)Versions (7)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

45

—

FairBetter than 93% of packages

Maintenance63

Regular maintenance activity

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

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 ~336 days

Recently: every ~359 days

Total

6

Last Release

542d 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 (42 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

[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)
