PHPackages                             waughj/test-hash-item - 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. waughj/test-hash-item

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

waughj/test-hash-item
=====================

A collection o’ helper functions for testing properties o’ a hash item

v2.0.0(6y ago)042915AGPL-3.0-or-laterPHPPHP &gt;=7.0

Since Jun 4Pushed 6y agoCompare

[ Source](https://github.com/waughjai/test-hash-item)[ Packagist](https://packagist.org/packages/waughj/test-hash-item)[ RSS](/packages/waughj-test-hash-item/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (1)Versions (5)Used By (15)

Test Hash Item
==============

[](#test-hash-item)

A collection o’ helper functions for testing properties o’ a hash item.

There are 2 main types o’ functions:

- those that just test a boolean true / false for a condition, which all take in the arguments: $list, $key. All test if value exists ( if $list\[ $key \] is set ).
- those that return $list\[ $key \] if the condition is true &amp; return given fallback if not, which all take in arguments: $list, $key, $fallback. $fallback can be any type o’ value &amp; defaults to null if nothing is given for it.

Boolean functions:

- exists: only tests if value exists.
- isString
- isArray
- isNumeric
- isBool
- isObject
- isClass: this takes in $class, $list, $key as arguments ’stead. $class is the specific name o’ the class testing for, as opposed to isObject, which accepts any object type.

Getter functions: ( these are use the previous tests for determining whether to return $list\[ $key \] or $fallback )

- getExists
- getString
- getArray
- getBool
- getObject
- getClass

Finally, there are generic test &amp; testIs methods, which have a callable as the 1st argument.

Changelog
---------

[](#changelog)

### 2.0.0

[](#200)

- Refactor to make class with static functions ’stead o’ just functions to make working with namespace easier.

### 1.1.0

[](#110)

- Add TestHashItemIsTrue Function

### 1.0.0

[](#100)

- Initial Stable Version

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

4

Last Release

2534d ago

Major Versions

v1.1.0 → v2.0.02019-06-04

PHP version history (2 changes)v1.0.0PHP &gt;=7.2

v2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11161078?v=4)[waughj](/maintainers/waughj)[@waughj](https://github.com/waughj)

---

Tags

testshash

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waughj-test-hash-item/health.svg)

```
[![Health](https://phpackages.com/badges/waughj-test-hash-item/health.svg)](https://phpackages.com/packages/waughj-test-hash-item)
```

###  Alternatives

[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

596161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[dama/doctrine-test-bundle

Symfony bundle to isolate doctrine database tests and improve test performance

1.2k37.2M144](/packages/dama-doctrine-test-bundle)[whatthejeff/nyancat-phpunit-resultprinter

Nyan Cat result printer for PHPUnit

283689.8k24](/packages/whatthejeff-nyancat-phpunit-resultprinter)[thedoctor0/laravel-factory-generator

Automatically generate Laravel factories for your models.

214997.4k1](/packages/thedoctor0-laravel-factory-generator)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)

PHPackages © 2026

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