PHPackages                             survos/debug-utils - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. survos/debug-utils

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

survos/debug-utils
==================

Development assertion helpers that show acceptable values on failure

2.10.19(1mo ago)053MITPHPPHP ^8.5

Since May 19Pushed 1mo agoCompare

[ Source](https://github.com/survos/debug-utils)[ Packagist](https://packagist.org/packages/survos/debug-utils)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-debug-utils/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (3)Versions (67)Used By (0)

survos/debug-utils
==================

[](#survosdebug-utils)

Assertion helpers that show the **acceptable** values on failure — not just "key not found".

When a CSV header, API payload, or config array has the wrong key, the mistake is almost always a typo, an underscore-vs-hyphen, or a capitalisation slip. A plain `array_key_exists` check tells you `name` is missing; these helpers tell you `name` is missing *and here are the keys that do exist* — so you spot `emial` next to `email` instantly.

Intentionally a **dev-only** dependency. Do not require it in production code.

Requirements
------------

[](#requirements)

- PHP 8.4+

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

[](#installation)

```
composer require --dev survos/debug-utils
```

Usage
-----

[](#usage)

All helpers are static methods on `Survos\DebugUtils\Assert` and throw `\InvalidArgumentException` on failure.

### `keyExists()` — one key must be present

[](#keyexists--one-key-must-be-present)

```
use Survos\DebugUtils\Assert;

$row = ['name' => 'Tac', 'email' => 'tac@example.com'];

Assert::keyExists('email', $row);   // ok
Assert::keyExists('emial', $row);   // throws
```

```
Missing key [emial]:
email
name

```

Accepts arrays or objects, and string or integer keys. The available keys are sorted, so the output is stable across runs.

### `keysExist()` — several keys must all be present

[](#keysexist--several-keys-must-all-be-present)

```
Assert::keysExist(['name', 'email', 'phone'], $row);
```

```
Missing keys [phone]:
email
name

```

### `inArray()` — value must be one of an allowed set

[](#inarray--value-must-be-one-of-an-allowed-set)

```
Assert::inArray($status, ['draft', 'published', 'archived']);
```

```
Unexpected value 'pubished'. Allowed: 'archived', 'draft', 'published'

```

Comparison is **strict**, so `'1'` is not accepted where `1` is allowed.

### Custom messages

[](#custom-messages)

Every helper takes an optional trailing `$message` appended to the failure output:

```
Assert::keyExists('id', $payload, 'check the /api/items response shape');
```

Development
-----------

[](#development)

```
composer install
vendor/bin/phpunit          # run the test suite
vendor/bin/phpstan analyse  # static analysis
vendor/bin/ecs check        # coding standard
```

License
-------

[](#license)

MIT

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance92

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

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

Total

66

Last Release

45d ago

PHP version history (2 changes)2.4.2PHP ^8.4

2.9.4PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/21b39551f92ed4143772c622f9e571589c5a72c96ab3c53fe67489ce0d83e806?d=identicon)[tacman1123](/maintainers/tacman1123)

---

Top Contributors

[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/survos-debug-utils/health.svg)

```
[![Health](https://phpackages.com/badges/survos-debug-utils/health.svg)](https://phpackages.com/packages/survos-debug-utils)
```

###  Alternatives

[jkocik/laravel-profiler

Profiler for Laravel Framework

188613.9k](/packages/jkocik-laravel-profiler)[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.6k](/packages/spatie-craft-ray)

PHPackages © 2026

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